SQL Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What does SQL stand for?

A

Structured Query Language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which function is used to fetch an item from a database?

A

SELECT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which function is used to insert data into a database?

A

INSERT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which function is used to edit/modify existing data in a database?

A

UPDATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which function is used to delete data from a database?

A

DELETE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which function is used to create a new data table?

A

CREATE TABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which function is used to delete a data table?

A

DROP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

(a) Using SQL write a command to fetch a CustomerID from Customers, where the BookingDate is 12/7/22 in Bookings.
(b) Sort these into descending order.

A

SELECT BookingID FROM Bookings
WHERE SELECT CustomerID = (SELECT CustomerID FROM Bookings WHERE BookingDate = “12/7/22”)
ORDER BY CustomerID DESC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Using SQL write a command to insert new values into a table called ‘Students’.

A

INSERT INTO Students
(StudentID, StudentName, DOB, Gender, Postcode)
VALUES
(“ST9”, “Adam”, “29/01/2001”, “M”, “OX69TG”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly