Database / SQL Flashcards

1
Q

Database

A

organized info so it can be accessed, managed and updated.

od amu

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

Relational DB

A

Type of DB where tables are related / linked by common data.

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

Tables

A

contain rows and cols. rows aka records. cols aka attributes.

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

Relational DB management system

A

a program that allows you to manage a relational database .

e.g. such as create and update info.

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

SQL

A

Structured Query Language

program language that allows user to communicate w/DBs. It allows to request data, or perform actions on data.

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

Why SQL

A

DTE
data + table + ebed
data = (MADD) allows users to access, describe, define, manipulate data
table = C(v)SD
C = tv
S= tv
allows users to create tables and views. drop tables. set permissions on tables and view and create stored procedures and fxs

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

Draw SQL Architecture

A

SQL query
query language processor < parser + optimization
DBMS engine < flies manager + transaction manager
Physical DB

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

What is a primary key

conditions:

A

a field uniquely identifies each record in a table.

  • only 1 unique primary key for table
  • each must contain unique values
  • no null values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is foreign key

A

links 2 tables together. aka referencing key.
the relationship (link) is the primary key matching the foreign key.
is a column

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

creating primary key

steps to create

A

-usually created while creating the table, but can be created after creation of table.

  1. create table
  2. create primary table

1.
a. write command “create table”
b. name table “x”
c.

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

sql statements

A

= used to perform tasks such as update and retrieve data.

d^3 (dmcc) L^4

table cad
data siud
permissions gr
db transactions src

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

SELECT Query

what are ways to select data

A

=allows you to select and get data from table.
results are returned in tables called result-sets.

-fetch ALL fields
SELECT * FROM table_name
SELECT column1, column2, FROM table_name;
eg: SELECT ID, NAME FROM CUSTOMERS

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

INSERT Query

how

A

= adds new rows of data to table

INSERT INTO table_name (column1, column2)
VALUES

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

What is SQL WHERE

A

used to specify a condition when fetching data.

WHERE [condition]

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

What are JOINS

Different types?

A

is a condition allows combine records from 2 or more tables.

Types = 4
Full, inner, left and rt

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