Structured Query Language 01

Structured Query Language 01

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

to auto insert a default value for a column when creating a table

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

1

Favorites

0

Last updated

6 years ago

Date created

Mar 14, 2020

Cards (10)

Section 1

(10 cards)

to auto insert a default value for a column when creating a table

Front

CREATE TABLE tblName ( fieldName1 VARCHAR(10), fieldName2 DEC(3,2) NOT NULL DEFAULT 1.00 );

Back

to auto increment a column when creating a table

Front

CREATE TABLE tblName ( fieldName1 INT NOT NULL AUTO_INCREMENT, fieldName2 VARCHAR(10) );

Back

attributes of a table in 1NF

Front

- each row of data must contain atomic values - each row of data must have a primary key - the primary key must be given a value when the record is inserted - the primary key must be compact - primary key values can't be changed

Back

database

Front

a container that holds tables and other SQL structures

Back

table

Front

the structure inside a database that contains data

Back

to add a new column that is a primary key to a table

Front

ALTER TABLE tblName ADD COLUMN fieldName1, ADD PRIMARY KEY (fieldName1);

Back

to add values to an existing table

Front

INSERT INTO tblName (fieldName1, fieldName2) VALUES (value1, value2);

Back

SQL data types

Front

CHAR, VARCHAR, INT, BLOB, DATE, TIME, DEC

Back

RDBMNS

Front

relational database management system

Back

atomic data

Front

- data that is broken down into the smallest pieces - can't have multiple columns with the same type of data

Back