Kategori: Basis Data

SQL allows the nesting of one query inside another, but only in the WHERE and the HAVING clauses. In addition, SQL permits a subquery only on the right hand side of an operator. Example 1 Find the names and IDs of all faculty members who teach a class in room 'H221'. You could do this with 2 queries as follows: SELECT FACID FROM…

Baca Selengkapnya » tentang NESTED QUERIES

A JOIN operation is performed when more than one table is specified in the FROM clause. You would join two tables if you need information from both. You must specify the JOIN condition explicitly in SQL. This includes naming the columns in common and the comparison operator. Example 1 Find the name and courses that each faculty …

Baca Selengkapnya » tentang MULTIPLE TABLE QUERIES

TABLES CREATE TABLE Define the structure of a new table Format: CREATE TABLE tablename ({col-name type ,...}); The 'constraint' clause in the CREATE TABLE statement is used to enforce referential integrity. Specifically, PRIMARY KEY, FOREIGN KEY, and CHECK integrity can be set when you define the table. The syntax for key and ch…

Baca Selengkapnya » tentang SQL DATA DEFINITION (DDL)

Many database management systems support some version of structured query language (SQL). In some DBMSs (i.e., ORACLE) SQL is the primary data manipulation interface. Consequently, SQL is a very important topic. The purpose of this document is to introduce you to the major SQL statements and to show you how they work. This docum…

Baca Selengkapnya » tentang Structured Query Language