CS401A's Pre-Finals: Info Management Module 06 Flashcards

For pre-final and final exams. (53 cards)

1
Q

Fundamentals

is a specific request for data manipulation issued by the end-user or the application to the DBMS.

A

A query

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

Fundamentals

  • SQL:
    ○ Stands for
A

Structured Query Language

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

Fundamentals

  • SQL:
    ○ Pronounced as
A

S-Q-L or “sequel”

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

Fundamentals

  • SQL:
    ○ Consists of commands that:
A
  • Create database and table structures
  • Perform various types of data manipulation and data administration
  • Query the database to extract useful information
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Fundamentals

  • Popular Database Management Tools
A

○ Microsoft SQL Server
○ MySQL
○ Oracle RDBMS
○ Microsoft Access

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

Fundamentals * SQL Data Types:

Category
Exact numeric

A

Common Data Types
bigint, bit, decimal, int, money, numeric

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

Fundamentals * SQL Data Types:

Category
Appropriate numeric

A

Common Data Types
float, real

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

Fundamentals * SQL Data Types:

Category
Date and time

A

Common Data Types
date, datetime, time

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

Fundamentals * SQL Data Types:

Category
Character strings

A

Common Data Types
char, text, varchar

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

Fundamentals * SQL Data Types:

Category
Unicode character strings

A

Common Data Types
nchar, ntext, nvarchar

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

Fundamentals * SQL Data Types:

Category
Binary strings

A

Common Data Types
binary, image, varbinary

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

Fundamentals * SQL Data Types:

Category
Other data types

A

Common Data Types
cursor, sql_variant, table, uniqueidentifier, xml

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

Fundamentals * SQL Operators:

Category
Arithmetic

A

Common Data Types
+, -, *, /, %

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

Fundamentals * SQL Operators:

Category
Comparison

A

Common Data Types
=, >, <, >=, <=, <>

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

Fundamentals * SQL Operators:

Category
Compound

A

Common Data Types
+=, -=, *=, /=, %=

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

Fundamentals * SQL Operators:

Category
Logical

A

Common Data Types
AND, OR, NOT, LIKE, IN, BETWEEN, EXISTS, ANY, ALL

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

SQL Data Definition Commands

— creates a new database

A
  • CREATE DATABASE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

SQL Data Definition Commands

— deletes an existing database

A
  • DROP DATABASE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

SQL Data Definition Commands

Example: WHAT DATABASE myDB;

A

CREATE
DROP

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

SQL Data Definition Commands

— creates a new table in a database

A
  • CREATE TABLE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

SQL Data Definition Commands

Example: WHAT TABLE Students (StudentID varchar(11), LastName varchar(99), FirstName varchar(99), Section varchar(5));

A

CREATE

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

SQL Data Definition Commands

— deletes an existing table in a database

23
Q

SQL Data Definition Commands

— WHAT an existing table in a database
Example: WHAT TABLE Students;

24
Q

SQL Data Definition Commands

○ To delete only the table’s data:

A

TRUNCATE TABLE

25
# **SQL Data Definition Commands** ○ To WHAT only the table's data: ▪ *Example*: TRUNCATE TABLE Students;
delete
26
# **SQL Data Definition Commands** — WHAT, WHAT, or WHAT columns in an existing table
* **ALTER TABLE** Adds deletes modifies
27
# **SQL Data Definition Commands** Adds, columns in an existing table ○ *Syntax to add*: **WHAT TABLE** *table_name* **WHAT** *column datatype*;
* **ALTER TABLE** **ALTER** **ADD**
28
# **SQL Data Definition Commands** WHAT, columns in an existing table ○ *Example*: ALTER TABLE Students ADD MiddleName varchar(99);
* **ALTER TABLE** Adds________
29
# **SQL Data Definition Commands** deletes, columns in an existing table ○ *Syntax to delete*: **WHAT TABLE** *table_name* **WHAT** *column*;
* **ALTER TABLE** **ALTER** **DROP**
30
# **SQL Data Definition Commands** WHAT, columns in an existing table ○ *Example*: ALTER TABLE Students DROP COLUMN Section;
* **ALTER TABLE** deletes
31
# **SQL Data Definition Commands** modifies columns in an existing table ○ *Syntax to modify*: **WHAT TABLE** *table_name* **WHAT COLUMN** *column datatype*;
* **ALTER TABLE** **ALTER** **ALTER**
32
# **SQL Data Definition Commands** WHAT columns in an existing table ○ *Example*: ALTER TABLE Students ALTER COLUMN MiddleName nvarchar(99);
* **ALTER TABLE** modifies
33
# **SQL Constraints** — ensures that a column cannot have a NULL value upon creating a table
* **NOT NULL** on CREATE TABLE
34
# **SQL Constraints** — ensures that a column cannot have a WHAT value upon WHAT a table ○ *Example*: CREATE TABLE Students (StudentID varchar(11) NOT NULL, LastName varchar(99) NOT NULL, FirstName varchar(99) NOT NULL, Section varchar(5));
* **NOT NULL** on CREATE TABLE NULL creating
35
# **SQL Constraints** — ensures that a column in an existing table cannot have a NULL value
* **NOT NULL** on ALTER TABLE
36
# **SQL Constraints** — ensures that a column in an WHAT table cannot have a WHAT value ○ *Example*: ALTER TABLE Students ALTER COLUMN Section varchar(5) NOT NULL;
* **NOT NULL** on ALTER TABLE existing NULL
37
# **SQL Constraints** — ensures that all values in a column are different upon creating a table
* **UNIQUE** on CREATE TABLE
38
# **SQL Constraints** — ensures that all values in a column are WHAT upon WHAT a table ○ *Example*: CREATE TABLE Students (StudentID varchar(11) NOT NULL UNIQUE, LastName varchar(99) NOT NULL, FirstName varchar(99) NOT NULL, Section varchar(5));
* **UNIQUE** on CREATE TABLE different creating
39
# **SQL Constraints** — creates a UNIQUE constraint on a column of an existing table ○ *Syntax*: **WHAT TABLE** Students *table_name* **WHAT WHAT** *(column)*;
* **UNIQUE** on ALTER TABLE **CREATE** **ADD UNIQUE**
40
# **SQL Constraints** — creates a WHAT constraint on a column of an WHAT table ○ *Example*: CREATE TABLE Students ADD UNIQUE (StudentID);
* **UNIQUE** on ALTER TABLE UNIQUE existing
41
# **SQL Constraints** — uniquely identifies each row in a table
* **PRIMARY KEY** on CREATE TABLE
42
# **SQL Constraints** — WHAT identifies each row in a table ○ *Example*: CREATE TABLE Students (StudentID varchar(11) NOT NULL PRIMARY KEY, LastName varchar(99) NOT NULL, FirstName varchar(99) NOT NULL, Section varchar(5));
* **PRIMARY KEY** on CREATE TABLE uniquely
43
# **SQL Constraints** — creates a PRIMARY KEY constraint on a column of an existing table ○ *Syntax*: **WHAT TABLE** *table_name* **WHAT WHAT WHAT** *(column)*;
* **PRIMARY KEY** on ALTER TABLE **CREATE** **ADD PRIMARY KEY**
44
# **SQL Constraints** — creates a WHAT WHAT constraint on a column of an WHAT table ○ *Example*: CREATE TABLE Students (StudentID varchar(11) NOT NULL PRIMARY KEY, LastName varchar(99) NOT NULL, FirstName varchar(99) NOT NULL, Section varchar(5));
* **PRIMARY KEY** on ALTER TABLE PRIMARY KEY existing
45
# **SQL Constraints** — uniquely identifies a row in another table ○ *Example*: WHAT TABLE Orders (OrderID int NOT NULL PRIMARY KEY, TableNumber int NOT NULL, CustomerID int WHAT WHAT WHAT Customers (CustomerID));
* **FOREIGN KEY** on CREATE TABLE CREATE FOREIGN KEY REFERENCES
46
# **SQL Constraints** — creates a FOREIGN KEY constraint on a column of an existing table ○ *Syntax*: **WHAT TABLE** *table1_name* **WHAT WHAT WHAT** *(table1_column)* **WHAT** *table2_name* *(table2_column)*;
* **FOREIGN KEY** on ALTER TABLE ALTER ADD FOREIGN KEY REFERENCES
47
# **SQL Constraints** — creates a WHAT WHAT WHAT constraint on a column of an WHAT table ○ *Example*: ALTER TABLE Orders ADD FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID);
* **FOREIGN KEY** on ALTER TABLE CREATE FOREIGN KEY existing
48
# **SQL Constraints** — ensures that all values in a column satisfy a specific condition upon creating a table ○ *Example*: WHAT TABLE Students (StudentID varchar(11) NOT NULL, LastName varchar(99) NOT NULL, FirstName varchar(99) NOT NULL, Age int WHAT (Age>=15));
* **CHECK** on CREATE TABLE CREATE CHECK
49
# **SQL Constraints** — ensures that all values in a column of an existing table satisfy a specific condition ○ *Syntax*: **WHAT TABLE** *table_name* **WHAT WHAT** *(condition)*;
* **CHECK** on ALTER TABLE **ALTER** **ADD CHECK**
50
# **SQL Constraints** — ensures that all values in a column of an WHAT table WHAT a WHAT WHAT ○ *Example*: ALTER TABLE Students ADD CHECK (Age>=15);
* **CHECK** on ALTER TABLE existing satisfy specific condition
51
# **SQL Constraints** — sets a default value for a column when there is no value specified ○ *Example*: WHAT TABLE Students (StudentID varchar(11) NOT NULL, LastName varchar(99) NOT NULL, FirstName varchar(99) NOT NULL, Section varchar(5) WHAT 'Not yet enrolled');
* **DEFAULT** on CREATE TABLE CREATE DEFAULT
52
# **SQL Constraints** — sets a default value for a column of an existing table when there is no value specified ○ *Syntax*: **WHAT TABLE** *table_name* **WHAT WHAT** *WHAT name* **WHAT** *'value'* **WHAT** *column*;
* **DEFAULT** on ALTER TABLE **ALTER** **ADD CONSTRAINT** *constraint* **DEFAULT** **FOR**
53
# **SQL Constraints** — sets a WHAT value for a column of an existing table when there is no value specified ○ *Example*: ALTER TABLE Students ADD CONSTRAINT df_section DEFAULT 'Not yet enrolled' FOR Section;
* **DEFAULT** on ALTER TABLE default existing