Premium Essay

Sql Study Guide

In:

Submitted By alexandrapet
Words 711
Pages 3
SELECT Field(s) FROM database.table (optional) WHERE [Logical_Expression] (optional) GROUP BY [Field(s)] (optional) HAVING [Logical_Expression]
(optional) ORDER BY [Field(s)]
DISPLAY ALL FIELDS:
SELECT * FROM hr.Employees;

*NO QUOTES FOR NUMBERS
*’YYYY-MM-DD’
*IS NULL can be used as WHERE condition

INTERSECTION CONDITION:
SELECT fields FROM database.table
WHERE condition AND condition;
UNION CONDITION:
SELECT fields FROM database.table
WHERE condition OR condition;
RANGE CONDITION:
BETWEEN 5000 AND 10000 or combination of AND & RELATIONAL OPERATORS
NOT (not !=):
WHERE NOT (salary >= 5000 OR job_id = 'IT_PROG') ;
*AND has precedence over OR
USE % AS PLACEHOLDER FOR INDEFINITE NUMBER OF CHARACTERS:
SELECT * FROM hr.employees
WHERE last_name LIKE '%a%a%'
USE _ AS PLACEHOLDER FOR EXACTLY ONE CHARACTER:
SELECT * FROM hr.employees
WHERE last_name LIKE 'Jo_'
LENGTH() FUNCTION:
SELECT first_name, LENGTH(first_name) FROM hr.employees
CREATE TABLE:
CREATE TABLE Animal_Disease (
Animal_ID DECIMAL (6,0),
Disease_ID DECIMAL(6,0),
Date DATE,
Treatment VARCHAR (30),
Caretaker_ID DECIMAL (6,0)
CONSTRAINT AD_PK PRIMARY KEY (Animal_ID, Disease_ID)
CONSTRAINT Caretaker_FK FOREIGN KEY (Caretaker_ID) REFERENCES Caretaker (Caretaker_ID) );
OR
CREATE TABLE Animal_Disease (
Animal_ID DECIMAL (6,0) PRIMARY KEY,
Disease_ID DECIMAL(6,0),
Date DATE,
Treatment VARCHAR (30),
Caretaker_ID DECIMAL (6,0)
CONSTRAINT Caretaker_FK FOREIGN KEY (Caretaker_ID) REFERENCES Caretaker (Caretaker_ID) );

*CAN USE THE ABOVE CONSTRAINT FOR COMPOSITE OR SINGULAR PRIMAR KEYS
CHECK CONSTRAINT:
CHECK (Gender IN ('M', 'F'))
DEFAULT CONSTRAINT:
DEFAULT 'FLEA'
FOREIGN KEY CONSTRAINTS:
ON DELETE SET NULL ON UPDATE SET NULL
ON DELETE CASCADE ON UPDATE CASCADE
DROPPING TABLE:
DROP TABLE tablename
ALTERING

Similar Documents

Premium Essay

Sql Final Study Guide

...Introduction to SQL * What is SQL: SQL environment, the three types of commands (DDL, DML, DCL) * SQL * Structured Query Language * High level declarative language for relational database * De facto standard in the database world * Is now an official standard too, accepted by * American National Standards Institute (ANSI) * International Organization for Standardization (ISO) * The first standard (1986): SQL/86 * Several subsequent versions * SQL-89, SQL-92, SQL-1999, SQL-2003 (XML), SQL-2006, SQL-2008; SQL-2011 * DDL * Define the database * Base tables: CREATE, ALTER and DROP a TABLE, VIEW or INDEX (you drop a table but not delete it) * Views - Virtual (or derived) tables: CREATE VIEW, ALTER VIEW, DROP VIEW * Notation: Angle brackets indicate mandatory * CREATE TABLE <table name> ( <column name> <data type> [DEFAULT<data value>] [column constraint clause] … [table constraint clause] ); * Each tables contains several attributes * Each attribute has a name and a data type and may be subject to some integrity constraints * Constraints can be defined for a table or attribute * Oracle doesn't permit some reserved keywords to be used as names of tables, columns, or constraints: ( order, number, type, comment, date, char, number, create, table, attribute, database ) ...

Words: 1703 - Pages: 7

Premium Essay

Tut Letter101/3/2015

...ENG2602/101/3/2015 Tutorial letter 101/3/2015 GENRES IN LITERATURE AND LANGUAGE: THEORY, STYLE AND POETICS ENG2602 Semesters 1 & 2 Department of English Studies IMPORTANT INFORMATION: This Tutorial Letter contains important information about your module. CONTENTS Page 1 INTRODUCTION .......................................................................................................................... 3 2 PURPOSE OF AND OUTCOMES FOR THE MODULE............................................................... 4 2.1 Purpose ........................................................................................................................................ 4 2.2 Outcomes .....................................................................................................................................4 3 LECTURER(S) AND CONTACT DETAILS................................................................................... 5 3.1 Lecturer(s) .................................................................................................................................... 5 3.2 Department ................................................................................................................................... 6 3.3 University ...................................................................................................................................... 6 4 MODULE-RELATED RESOURCES ..................

Words: 5933 - Pages: 24

Free Essay

Bus 352 (E-Business) Complete Class All Weeks Dqs, Quizzes and Assignments

...BUS 352 , BUS 352 Phoenix, BUS 352 Uop help, BUS 352 Week 3, BUS 352 Individual Assignment , BUS 352 Learning team Assignment, BUS 352 Product, BUS 352 A Graded , BUS 352 Summary, BUS 352 Study Guide, BUS 352 Questions , BUS 352 Answered , BUS 352 Solution, BUS 352 Final Guide, BUS 352 Final Exam, BUS 352 A++ Work, BUS 352 A Graded, BUS 352 Homework, BUS 352 help, BUS 352 week 1 DQ, BUS 352 week 2 DQ, BUS 352 week 3DQ, BUS 352 week 4 DQ, BUS 352 week 5DQ, BUS 352 week 6 DQ, BUS 352 week 1 Assignment, BUS 352 week 2 Assignment, BUS 352 week 3Assignment, BUS 352 week 4 Assignment, BUS 352 week 5 Assignment, BUS 352 All Individual and Learning Team Assignments, BUS 352 Full Course , BUS 352 Whole Class BUS 352 Entire Solution, BUS 352 University of Phoenix Learning Team Assignment, BUS 352 Checkpoint, BUS 352 All Weeks , BUS 352 Week 1-5, BUS 352 Axia College, BUS 352 online class, BUS 352 week 3DQ, BUS 352 week 4 DQ, BUS 352 week 5DQ, BUS 352 Syllabus, BUS 352 Version, BUS 352 Week 1, BUS 352 Week 2, BUS 352 Week 3, BUS 352 Week 4, BUS 352 Week 5, BUS 352 week 1 DQ, BUS 352 week 2 DQ,, BUS 352 Assignment 1 , BUS 352 Assignment 2, BUS 352 Assignment 3 , BUS 352 Week 1-6, BUS 352 Assignment4 , BUS 352 DQs, BUS 352 Dq 1, BUS 352 DQ 2, BUS 352 Complete Course, BUS 352 Entire Class, BUS 352 Whole Tutorial, BUS 352 Work, BUS 352 final Project, BUS 352 Material, BUS 352 tutorial, BUS 352 Complete...

Words: 497 - Pages: 2

Premium Essay

Ldr 531 Uop Complete Class Materials

...LDR 531 Week 2 Complete o LDR 531 Week 3 DQ 1 o LDR 531 Week 3 Leadership Style o LDR 531 Week 3 Mentorship Meeting Worksheet o LDR 531 Week 3 Quiz o LDR 531 Week 3 Complete o LDR 531 Week 4 DQ 1 o LDR 531 Week 4 DQ 2 o LDR 531 Week 4 Mentorship Meeting Worksheet o LDR 531 Week 4 Conflict Resolution o LDR 531 Week 4 Quiz o LDR 531 Week 4 Complete o LDR 531 Week 5 DQ 1 o LDR 531 Week 5 DQ 2 o LDR 531 Week 5 Mentorship Meeting Worksheet o LDR 531 Week 5 Motivation Plan o LDR 531 Week 5 Quiz o LDR 531 Week 5 Complete o LDR 531 Week 6 DQ 1 o LDR 531 Week 6 DQ 2 o LDR 531 Week 6 Failure Analysis Change Strategy o LDR 531 Week 6 Mentorship Meeting Worksheet o LDR 531 Week 6 Quiz o LDR 531 Week 6 Complete For More UOP Study Guide...

Words: 263 - Pages: 2

Free Essay

Macbeth

...Study Guides and Lesson PlansStudy smarter. Welcome, Guest!Set Background  Blackboard Green Chalkboard Desk Sign In Join eNotes . HOMEWORK HELPSTUDY GUIDESLESSON PLANSQUIZZESeBOOKS & DOCUMENTSETEXTSSHAKESPEAREMATH HELPSCIENCE HELPSUBJECTS subjects LITERATUREHISTORYSCIENCEMATHARTSBUSINESSSOCIAL SCIENCESLAW AND POLITICSHEALTHBLOGJOIN eNOTESeNOTES PEOPLE Homework Help Better Students Ask More Questions. In Macbeth, how does the sergeant characterize Macbeth in Act I? What images does he... user profile pic hyun980106 Student Undergraduate -------------------------------------------------------------------------------- eNotes Newbie Up1 DownTopic: Macbeth In Macbeth, how does the sergeant characterize Macbeth in Act I? What images does he associate with Macbeth? Posted by hyun980106 on March 5, 2009 at 9:55 AM via web and tagged with act i, literature, macbeth, sergeants description, the tragedy of macbeth 1 Answer | add yours user profile pic mshurn -------------------------------------------------------------------------------- College Teacher -------------------------------------------------------------------------------- (Level 1) Educator Emeritus Up2 DownFrom the sergeant's description of Macbeth in battle, we can conclude that Macbeth is a strong and valiant soldier who does not retreat, despite the odds against him. Macbeth fights furiously in defense of his King and country, his sword...

Words: 448 - Pages: 2

Free Essay

Hrm 531 Complete Class Week 1-5 All Dqs and Assignments

...HRM 531 , HRM 531 Phoenix, HRM 531 Uop help, HRM 531 Week 3, HRM 531 Individual Assignment , HRM 531 Learning team Assignment, HRM 531 Product, HRM 531 A Graded , HRM 531 Summary, HRM 531 Study Guide, HRM 531 Questions , HRM 531 Answered , HRM 531 Solution, HRM 531 Final Guide, HRM 531 Final Exam, HRM 531 A++ Work, HRM 531 A Graded, HRM 531 Homework, HRM 531 help, HRM 531 week 1 DQ, HRM 531 week 2 DQ, HRM 531 week 3DQ, HRM 531 week 4 DQ, HRM 531 week 5DQ, HRM 531 week 6 DQ, HRM 531 week 1 Assignment, HRM 531 week 2 Assignment, HRM 531 week 3Assignment, HRM 531 week 4 Assignment, HRM 531 week 5 Assignment, HRM 531 All Individual and Learning Team Assignments, HRM 531 Full Course , HRM 531 Whole Class HRM 531 Entire Solution, HRM 531 University of Phoenix Learning Team Assignment, HRM 531 Checkpoint, HRM 531 All Weeks , HRM 531 Week 1-5, HRM 531 Axia College, HRM 531 online class, HRM 531 week 3DQ, HRM 531 week 4 DQ, HRM 531 week 5DQ, HRM 531 Syllabus, HRM 531 Version, HRM 531 Week 1, HRM 531 Week 2, HRM 531 Week 3, HRM 531 Week 4, HRM 531 Week 5, HRM 531 week 1 DQ, HRM 531 week 2 DQ,, HRM 531 Assignment 1 , HRM 531 Assignment 2, HRM 531 Assignment 3 , HRM 531 Week 1-6, HRM 531 Assignment4 , HRM 531 DQs, HRM 531 Dq 1, HRM 531 DQ 2, HRM 531 Complete Course, HRM 531 Entire Class, HRM 531 Whole Tutorial, HRM 531 Work, HRM 531 final Project, HRM 531 Material, HRM 531 tutorial, HRM 531 Complete...

Words: 497 - Pages: 2

Free Essay

Eco 305 Wk 1 Homework Ch 2 - 12(a-B), 13(a-C), 14

...13(a-d); Ch. 4 - 15(a-b),16(a-b), ECO 305 WK 2 Quiz 1 - Chapters 1 and 2, ECO 305 WK 5 Homework Ch 8 - 6(a-d) , ECO 305 WK 5 Quiz 4 - Chapter 7 , ECO 305 WK 6 Homework Ch 9 - 11(a-c), 12(a-c), ECO 305 WK 6 Quiz 5 - Chapter 8 - All Possible Questions, ECO 305 WK 9 Quiz 8 - Chapters 12 and 13 , ECO 305 WK 11 Quiz 10 - Chapters 16 & 17 , ECO 305 Complete Class Assignments | strayer help, ECO 305 Strayer ECO 305 Week 1, ECO 305 Week 2, ECO 305 Week 3, ECO 305 Week 4, ECO 305 Week 5, ECO 305 week 2 Assignment, ECO 305 week 3Assignment, ECO 305 week 4 Assignment, ECO 305 week 1 Assignment, ECO 305 tutorial, ECO 305 Complete Course, ECO 305 Entire Class, ECO 305 Whole Tutorial, ECO 305 tutorial, ECO 305 Summary, ECO 305 Study Guide, ECO 305 Questions , ECO 305 Answered , ECO 305 Solution, ECO 305 Final , ECO 305 Presentation, ECO 305 Universty, ECO 305 University of, ECO 305 Homework, ECO 305 Version, ECO 305 Strayer assignment, ECO 305 Strayer course, ECO...

Words: 252 - Pages: 2

Free Essay

Apology Admission of Ignorance

...“I thought to myself: I am wiser than this man; neither of us probably knows anything that is really good, but he thinks he has knowledge, when he has not, while I, having no knowledge, do not think I have.” ― Plato, Apology tags: apology, knowledge, plato, socrates, wisdom 23 people liked it like “Men of Athens, I honor and love you; but I shall obey God rather than you, and while I have life and strength I shall never cease from the practice and teaching of philosophy... Understand that I shall never alter my ways, not even if I have to die many tim Apology: Top Ten Quotes Top Ten Quotes | 1) "I am very conscious that I am not wise at all," (Socrates)2) "in my investigation in the service of the god I found that those who had the highest reputation were nearly the most deficient, while those who were thought to be inferior were more knowledgeable." (Socrates)3) "Either I do not corrupt the young or, if I do, it is unwillingly," (Socrates)4) "You are wrong, sir, if you think that a man who is any good at all should take into account the risk of life or death; he should look to this only in his actions, whether what he does is right or wrong, whether he is acting like a good or a bad man." (Socrates)5) "To fear death, gentlemen, is no other than to think oneself wise when one is not, to think one knows what one does not know." (Socrates)6) "I will not yield to any man contrary to what is right, for fear of death, even if I should die at once for not yielding." (Socrates)7)...

Words: 1604 - Pages: 7

Free Essay

Reflection: Studying

...to get notes down in every class so that I can understand the material. Next the book talks about demoting assignments, and how you should choose which assignments to do over others. If you have multiple sources to read for a paper then you should only read the most credible sources so you get the important material and don’t read the same thing multiple times. I have not had a class yet that gives out multiple reading assignments for a paper. The book gives a good a good example that I would use if I did have and assignment that was like that. I think it would make sure I get everything that I need to know. Next the book talks about making a study guide for your classes. They talk about ripping out your notes and putting them together by topic. Then they say to make questions for the study guides so you can answer them to study from. I mark at the top of the...

Words: 563 - Pages: 3

Free Essay

Why I Prefer to Use Machines Instead of Hands

...hands since they think it will be more reliable and trustful. As a student, I prefer to do work by machines instead of hands especially when I am doing work for school. One vital beneficial of technology is it’s convenient and much easier and faster than human hands. Being a student at school, there is tons of work everyday. Each teacher will require work such as writing an essay or finishing some study guide. I have been using computer for several years, and my typing speed is much faster than when I doing the same thing by hands. Writing by hands turns to be some tougher work to me since I have use computer instead of hands for a long time and I definitely know which way is easier. For example, I had two study guides last semester for world history and biology. There were abundant of knowledge needing to memorize for both of them. However, my world history teacher required us to use pen and gave us the reason that writing by hands is better for people to memorize things. But the results turned out that I did better in biology test. I only took about 30 minutes to finish the study guide since I had all the separate notes of each chapter for biology while I took almost the whole day to finish world history. The...

Words: 573 - Pages: 3

Free Essay

Acct 567 Entire Course (Keller)

...ACCT 567 , ACCT 567 Phoenix, ACCT 567 Uop help, ACCT 567 Week 3, ACCT 567 Individual Assignment , ACCT 567 Learning team Assignment, ACCT 567 Product, ACCT 567 A Graded , ACCT 567 Summary, ACCT 567 Study Guide, ACCT 567 Questions , ACCT 567 Answered , ACCT 567 Solution, ACCT 567 Final Guide, ACCT 567 Final Exam, ACCT 567 A++ Work, ACCT 567 A Graded, ACCT 567 Homework, ACCT 567 help, ACCT 567 week 1 DQ, ACCT 567 week 2 DQ, ACCT 567 week 3DQ, ACCT 567 week 4 DQ, ACCT 567 week 5DQ, ACCT 567 week 6 DQ, ACCT 567 week 1 Assignment, ACCT 567 week 2 Assignment, ACCT 567 week 3Assignment, ACCT 567 week 4 Assignment, ACCT 567 week 5 Assignment, ACCT 567 All Individual and Learning Team Assignments, ACCT 567 Full Course , ACCT 567 Whole Class ACCT 567 Entire Solution, ACCT 567 University of Phoenix Learning Team Assignment, ACCT 567 Checkpoint, ACCT 567 All Weeks , ACCT 567 Week 1-5, ACCT 567 Axia College, ACCT 567 online class, ACCT 567 week 3DQ, ACCT 567 week 4 DQ, ACCT 567 week 5DQ, ACCT 567 Syllabus, ACCT 567 Version, ACCT 567 Week 1, ACCT 567 Week 2, ACCT 567 Week 3, ACCT 567 Week 4, ACCT 567 Week 5, ACCT 567 week 1 DQ, ACCT 567 week 2 DQ,, ACCT 567 Assignment 1 , ACCT 567 Assignment 2, ACCT 567 Assignment 3 , ACCT 567 Week 1-6, ACCT 567 Assignment4 , ACCT 567 DQs, ACCT 567 Dq 1, ACCT 567 DQ 2, ACCT 567 Complete Course, ACCT 567 Entire Class, ACCT 567 Whole Tutorial, ACCT 567 Work, ACCT 567...

Words: 497 - Pages: 2

Free Essay

Com 537 a+ Updated Tutorials

...Business Communication Process o COM 537 Week 2 Complete o COM 537 Week 3 DQ 1 o COM 537 Week 3 DQ 2 o COM 537 Week 3 DQ 3 o COM 537 Week 3 DQ 4 o COM 537 Week 3 Internal and External Stakeholders o COM 537 Week 3 Complete o COM 537 Week 4 DQ 1 o COM 537 Week 4 DQ 2 o COM 537 Week 4 DQ 3 o COM 537 Week 4 DQ 4 o COM 537 Week 4 Communication Plan Initial Proposal o COM 537 Week 4 Complete o COM 537 Week 5 DQ 1 o COM 537 Week 5 DQ 2 o COM 537 Week 5 DQ 3 o COM 537 Week 5 Internal and External Persuasive Communication o COM 537 Week 5 Complete o COM 537 Week 6 DQ 1 o COM 537 Week 6 DQ 2 o COM 537 Week 6 DQ 3 o COM 537 Week 6 DQ 4 o COM 537 Week 6 Communication Plan Final Proposal o COM 537 Week 6 Complete For More UOP Study Guide...

Words: 285 - Pages: 2

Free Essay

Nadda

...Review Guide Table of Contents OOPS ................................................................................................................................................................................................. 2 JAVA .................................................................................................................................................................................................. 3 C#....................................................................................................................................................................................................... 4 Database/SQL ................................................................................................................................................................................... 6 Web Development............................................................................................................................................................................ 7 SDLC................................................................................................................................................................................................... 9 UML ................................................................................................................................................................................................. 11 1 Review Guide OOPS Resources:  http://en.wikipedia...

Words: 2407 - Pages: 10

Premium Essay

Ggghhh

...Database Design – Final Exam Study Guide Name ________________________________________________ Date ___________________ Part I Directions: Answer each question. 1. What are the benefits the Oracle 10g Database Environment provides for business? Oracle's 10g database management system gives businesses the ability to coordinate and share computing, application, data, storage, or network resources across dynamic and geographically dispersed organizations and in turn save time, resources and money. 2. What services and products does Oracle provide? Information Technology services and products. 3. What is a relational database? A relational database is a group of data stored in tables that are related by means of a common field. 4. What is the difference between application and system software? Provide an example. Systems software consists of low-level programs designed to interact with the computer hardware. Application Software is the code that allows end users to interact with computers, like for instance Firefox for browsing the internet, Microsoft Word for writing documents, Application Express for developing applications and also for accessing and manipulating data in an Oracle Database. 5. How is data extracted from the database? Data is extracted from the database by the SELECT statement. 6. Name two benefits of a career portfolio? • To organize the many details of one's experiences • To help with goal setting 7. What is the difference between a projection, a selection,...

Words: 2537 - Pages: 11

Free Essay

Itt Tech

...allows more hands on teaching. W3school allows you to create your own code and run it, while providing results. When SQLCourse just gives you the answers to code questions. To me, SQLCourse is more like a study guide. I learn a lot better when I complete my work hands on. And W3school.com makes me feel like I’m really learning. Look up the data types for Oracle. How do they differ from SOL Server’s? Number datatype convert from Oracle to SQL Server | Oracle(source) | SQL Server(target) | number | Float | number([1-38]) | numeric([1-38]) | number([0-38],[1-38]) | numeric([0-38],[1-38]) | float | float | float([1-53]) | float([1-53]) | float([54-126]) | float | binary_float | float | binary_double | float(53) | int | numeric(38) | real | float | Number datatype convert from SQL Server to Oracle | SQL Server(source) | Oracle(target) | bigint | NUMBER(19) | int | NUMBER(10) | smallint | NUMBER(5) | tinyint | NUMBER(3) | bit | NUMBER(3) | numeric | NUMBER(p[,s]) | money | number(19,4) | smallmoney | NUMBER(10,4) | float | FLOAT(49) | real | FLOAT(23) | Look up the ANSI data types. How do they differ from that of SQL Server and Oracle? ANSI uses different names for data types than both Oracle and SQL Server. ANSI SQL Datatype | Oracle Datatype | CHARACTER(n)CHAR(n) | CHAR(n) | CHARACTER VARYING(n)CHAR VARYING(n) | VARCHAR2(n) |...

Words: 359 - Pages: 2