This site is 100% ad supported. Please add an exception to adblock for this site.

SQL - Basics

Terms

undefined, object
copy deck
What does the DML query/update command SELECT do?
Extracts data from a database table.
What does the DML query/update command UPDATE do?
Updates data in a database table.
What does the DML query/update command DELETE do?
Deletes data from a database table.
What does the DML query/update command INSERT INTO do?
Inserts new data into a database table.
What does DML stand for?
Data Manipulation Language
What does the DDL query/update command CREATE TABLE do?
Creates a new database table.
What does the DDL query/update command ALTER TABLE do?
Alters (changes) a database table.
What does the DDL query/update command DROP TABLE do?
Deletes a database table.
What does the DDL query/update command CREATE INDEX do?
Creates and index (search key).
What does the DDL query/update command DROP INDEX do?
Deletes an index.
What does DDL stand for?
Data Definition Language
What does SQL stand for?
Structured Query Language
What is the syntax for using a select statement?
SELECT column_name(s)
FROM table_name
How do you select multiple columns using the SELECT statement?
Separate the column names with commas. Ex:

SELECT column_name1, column_name2
FROM table_name
What is the syntax used to select all columns from a table?
SELECT * FROM table_name
A semicolon is the standard way to separate each SQL statement in database systems that allow more than one SQL statement to be executed in the same call to the server. Is it necessary to use a semicolon?
Not always. It depends on the database program you are using.
The result from a SQL query is stored in a ______-___. Most database software systems use programming functions, like: Move-To-First-Record, Get-Record-Content, Move-To-Next-Record, etc. to navigate this with.
result-set
The DISTINCT keyword is used to return only distinct (different) values. What is the syntax of a SELECT statement with this keyword added to it?
SELECT DISTINCT column_name(s)
FROM table_name
What is the syntax for using a WHERE clause in a SELECT statement?
SELECT column_name FROM table
WHERE column_name <operator> value
True or False: SQL uses single quotes around text values (most database systems will also accept double quotes). Numeric values however should also be enclosed in quotes.
False, numeric values should not be enclosed in quotes.
The LIKE condition is used to specify a search for a pattern in a column. What is the syntax of using LIKE in a SELECT statment?
SELECT column_name FROM table
WHERE column_name LIKE pattern_type
A "%" sign can be used to define wildcards (missing letters in the pattern) both before and after the pattern in a LIKE condition. What would the syntax be for a statement that will return all people with first names that start with an 'O' in t
SELECT * FROM Persons
WHERE FirstName LIKE 'O%'
A "%" sign can be used to define wildcards (missing letters in the pattern) both before and after the pattern in a LIKE condition. What would the syntax be for a statement that will return all people with first names that contain the letters 'l
SELECT * FROM Persons
WHERE FirstName LIKE '%la%'
The INSERT INTO statement is used to insert new rows into a table. What is the syntax for using this command?
INSERT INTO table_name
VALUES (value1, value2,....)
Using INSERT INTO, it is possible to specify which column to insert new data into. What is the syntax for this?
INSERT INTO table_name (column_name1, column_name2,...)
VALUES (value1, value2,....)
The UPDATE statement is used to modify the data in a table. What is the syntax for this?
UPDATE table_name
SET column_name = new_value
WHERE column_name = some_value
The DELETE statement is used to delete rows in a table. What is the syntax for this?
DELETE FROM table_name
WHERE column_name = some_value

Deck Info

27

permalink