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 nam…
Baca Selengkapnya » tentang NESTED QUERIESA 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 S…
Baca Selengkapnya » tentang MULTIPLE TABLE QUERIESThe ORDER BY clause is used to force the query result to be sorted based on one or more column values. You can select either ascending or descending sort for each named column. Example 1 List the name…
Baca Selengkapnya » tentang ORDERING OF THE QUERY RESULTAggregate functions allow you to calculate values based upon all data in an attribute of a table. The SQL aggregate functions are: Max, Min, Avg, Sum, Count, StdDev, Variance. Note that AVG and SUM wo…
Baca Selengkapnya » tentang COLUMN FUNCTIONS (AGGREGATE FUNCTIONS)The WHERE clause can be enhanced to be more selective. Operators that can appear in WHERE conditions include: =, <>,<,>,>=,<= IN BETWEEN...AND... LIKE IS NULL AND, OR, NOT Example 1 …
Baca Selengkapnya » tentang MORE COMPLEX SINGLE TABLE RETRIEVALExample 1 Retrieve all information about students ('*' means all attributes) SELECT * FROM STUDENT; STUID LNAME FNAME MAJOR CREDITS S1001 Smith Tom History 90 S1010 Burns Edward Art 63 S1015 Jones Mar…
Baca Selengkapnya » tentang SIMPLE SINGLE TABLE RETRIEVALThe DML component of SQL is the part that is used to query and update the tables (once they are built via DDL commands or other means). By far, the most commonly used DML statement is the SELECT. It c…
Baca Selengkapnya » tentang SQL DATA MANIPULATION LANGUAGE (DML)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 inte…
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 impor…
Baca Selengkapnya » tentang Structured Query LanguageManajemen Struktur Basis Data Tanggung jawab DBA dalam menangani struktur basisdata adalah: Merancang skema DBA biasanya tidak terlibat dalam perancangan basisdata mulai dari awal. Oleh karena itu, se…
Baca Selengkapnya » tentang Tugas dan Tanggung Jawab DBA