SQL(1.3.2 d) Flashcards

1
Q

SQL

A

declarative query language
standardised way to add/remove/change/read data from a relational database
interacts with the abstract concept of tables

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

DBMS stands for

A

DataBase Management System

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

SQL select

A

simplest operation to find data from a single table
* = everything
SELECT * FROM Person
WHERE FirstName = “Douglas”;

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

SQL boolean

A

combining conditions with boolean
behaves as you would expect (AND, OR)
SELECT Surname FROM Person
WHERE Surname = “Adams OR PersonID = “24601”

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

SQL wildcards

A

using % as a wildcard
% means “any character(s)”
D% = D then any character(s)
SELECT Surname FROM Person
WHERE FirstName LIKE “%o”

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

SQL inserting

A

specify the table (and fields)
provide the value to insert
INSERT INTO Person (PersonID, FirstName, Surname)
VALUES (18989,, “Techno”, “Tronics”);

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

SQL deleting

A

specify the table
specify the conditions to find records to delete
DELETE FROM Person
WHERE FirstName = “Techno”;

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

SQL update

A

specify the table
specify the field to change
identify the specific record(s) you want to change
UPDATE Person
SET FirstName = “Atari”
WHERE Surname = “Sinclair”;

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

SQL drop

A

specify the table
gets banished to shadow realm
DROP TABLE Person;

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

SQL joins

A

select each field you want (from either table)
join the two tables together with a common field (e.g primary and foreign key)
JOIN many also be called INNER JOIN
SELECT ProductID, ProductName.CategoryName
FROM Product
JOIN Category ON Product.CategoryID = Category.CategoryID;

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