Save
Computer science
3.7 Relational databases and structured query language (SQL)
Save
Share
Learn
Content
Leaderboard
Learn
Created by
Boadi
Visit profile
Cards (222)
In SQL, we can create a database using the
CREATE DATABASE
statement
The
foreign key
links one or more tables together by referencing the
primary key
from another table
A
primary key
is an
attribute
that
uniquely
identifies every
record
within the table
To delete an entire table from a database, use the
DROP TABLE statement.
A
join
is used to combine data from two or more
tables
into a
single result
set
The
SELECT
statement is used to retrieve data from one or more
tables.
A
WHERE clause
is used with the
SELECT
statement to filter rows based on
specific
conditions.
An
inner join
returns only rows that have
matching
values in both tables
To delete all records with a specific value in a column, use
DELETE FROM tablename WHERE condition
To add data to a table, use the
INSERT INTO
statement.
An
index
is used to speed up searching through
large
amounts of data
A
left outer join
returns all rows from the first table and
matching
rows from the second table
To update existing records in a table, use the
UPDATE
statement.
An
index
is a structure that allows
faster
access to specific
records
in a table
To remove specific rows from a table, use the
DELETE FROM statement.
The
SELECT
statement retrieves information from a specified
table(s)
To update multiple rows at once, use
UPDATE
tablename
SET field1
=
newvalue1
[
field2
=
newvalue2
...] WHERE
condition
An
index
is created on columns with
high selectivity
to
speed up queries
An
ORDER BY clause
can be added to sort the results returned by the
SELECT statement.
The
WHERE clause
filters rows based on
conditions
specified
The
WHERE clause
filters rows based on
conditions
specified
The
WHERE clause
filters rows based on
conditions
specified
The
GROUP BY clause
groups records according to
specific criteria
The
WHERE clause
specifies
conditions
that must be met for
rows
to be included in the
output
The
WHERE clause
specifies
conditions
that must be met for
rows
to be included in the
output
The
GROUP BY clause groups
records based on common values in one or more columns.
The
GROUP BY clause groups
records based on common values in one or more columns.
A
left outer join
returns all rows from the first table and
matches
them with any corresponding rows from the
second
table
To update multiple columns at once, separate them by
commas
within the
SET
keyword
To update multiple columns at once, separate them by
commas
within the
SET
keyword
To create a database, use
CREATE DATABASE
command.
To create a database, use
CREATE DATABASE
command.
A
full outer join
returns
all
rows from both tables and
matches
them with any corresponding rows
To update multiple columns at once, separate them by
commas
within the
SET
keyword
To create a database, use
CREATE DATABASE
command.
A
full outer join
returns
all
rows from both tables and
matches
them with any corresponding rows
A
full outer join
returns
all
rows from both tables and
matches
them with any corresponding rows
Foreign keys
link related information between different
tables
Foreign keys
link related information between different
tables
The
GROUP BY clause
groups rows by one or more columns
See all 222 cards