Database Reference
In-Depth Information
Because each DBMS product implements indexing in different ways, we discuss the
specific implementation of indexing of each DBMS as part of our detailed discussions of each
DBMS product:
●  Microsoft SQL Server 2012 in Chapter 10A
●  Oracle Database 11 g Release 2 in Chapter 10B
●  Oracle MySQL 5.6 in Chapter 10C
Topics on systems analysis and design often identify three design stages:
By ThE WAy
● 
Conceptual design (conceptual schema)
● 
Logical design (logical schema)
● 
Physical design (physical schema)
The creation and use of indexes is a part of the physical design , which is defined in
these topics as the aspects of the database that are actually implemented in the DBMS.
Besides indexes, this includes physical record and file structure and organization, and
query optimization. We discuss some of these issues in Chapter 10A for Microsoft SQL
Server 2012, in Chapter 10B for Oracle Database 11 g Release 2, and in Chapter 10C for
MySQL 5.6),
SQL DML Statements
At this point, you have learned how to query tables using SQL SELECT statements (in
Chapter 2), and you know how to create, alter, and drop tables, columns, and constraints. You
do not yet know, however, how to use SQL statements to insert, modify, and delete data. We
consider those statements next.
The SQL INSERT Statement
The SQL INSERT statement is used to add rows of data to a table. The statement has a num-
ber of different options.
The SQL INSERT Statement Using Column Names
The standard version of the INSERT statement is to name the table, name the columns for
which you have data, and then list the data in the following format:
/* *** EXAMPLE CODE - DO NOT RUN *** */
/* *** SQL-INSERT-CH07-01 *** */
INSERT INTO ARTIST
(LastName, FirstName, Nationality, DateOfBirth, DateDeceased)
VALUES ('Miro', 'Joan', 'Spanish', 1893, 1983);
Note that both column names and values are enclosed in parentheses, and DBMS popu-
lated surrogate keys are not included in the statement. If you are providing data for all of the
columns, if that data is in the same order as the columns in the table, and if you have no sur-
rogate keys, then you can omit the column list.
/* *** EXAMPLE CODE - DO NOT RUN *** */
/* *** SQL-INSERT-CH07-02 *** */
INSERT INTO ARTIST VALUES
('Miro', 'Joan', 'Spanish', 1893, 1983);
 
 
Search WWH ::




Custom Search