SQL Flashcards

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

How to create table

A
CREATE TABLE tablename(
              MemberId CHAR(6),
              FirstName VARCHAR(30),
              InstructorID INT,
              PRIMARY KEY (MemberID)
              FOREIGN KEY (...) REFERENCES othertable(...));
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define SQL Data Types

A
VARCHAR (n)
CHAR (n)
DATE
INT
BOOLEAN
DECIMAL (n,n)

NOT NULL - cannot be empty

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

Define SQL

A

Structured Query Language

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

SQL Syntax

A

SELECT … , … FROM Table

WHERE name = ‘John’;

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

SQL Order

A

ORDER BY …;
Auto Ascending
ORDER BY … DESC;

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

SQL Operators

A

= Equal to

<> Not Equal to

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

SQL KeyWords

A
WHERE ... IN ' ' 
WHERE ... NOT IN ' '
WHERE ... BETWEEN ... AND ...
WHERE ... IS NULL
WHERE ... LIKE ...%

% - zero, one, multiple characters
_ - single character

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

SQL Join Tables

A

SELECT Member.__, Job.___ FROM Member, Job

WHERE Member…. = Job….

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

SQL Insert Into

A

INSERT INTO table(…, …)
VALUES(…, …)

IV

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

SQL Update

A

UPDATE table
SET Fee = 25
WHERE … = ‘ ‘;

USW

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

SQL Delete

A

DELETE FROM table

WHERE …;

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