Premium Essay

Sql Study Guide

In: Computers and Technology

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

Study Guide

...MGMT591 Final Exam Study Guide YOU MAY WANT TO PRINT THIS GUIDE. 1. The Final Exam is "open book, open notes." The maximum time you can spend in the exam is three hours, 30 minutes. If you have not clicked the Submit for Grade button by then, you will be automatically exited from the exam. In the Final Exam environment, the Windows clipboard is disabled, so you will not be able to copy exam questions or answers to or from other applications. 2. You should click the Save Answers button in the exam frequently! This helps prevent connection timeouts that might occur with certain Internet service providers, and also minimizes lost answers in the event of connection problems. If your Internet connection does break, when you reconnect, you will normally be able to get back into your Final Exam without any trouble. Remember, though, that the exam timer continues to run while students are disconnected, so students should try to re-login as quickly as possible. The Help Desk cannot grant any student additional time on the exam. 3. See Syllabus "Due Dates for Assignments & Exams" for due date information. 4. Reminders * You will only be able to enter your online Final Exam one time. * Click the Save Answers button often. * If you lose your Internet connection during your Final Exam, logon again and try to access your Final Exam. If you are unable to enter the Final Exam, first contact the Help Desk and then your instructor. * You will always be able to......

Words: 1634 - Pages: 7

Premium Essay

Study Guide

...MG1016 – Managing Information with Technology UG study guide for 2012/13 MG1016 – Managing Information with Technology UG study guide for 2012/13 Date last updated: [08/08/12] Date approved by module reviewer: Date checked by PG pathway leader: [10/09/12] Date last updated: [08/08/12] Date approved by module reviewer: Date checked by PG pathway leader: [10/09/12] Introduction You should read this study guide carefully and also ensure that all the links have been followed to other accompanying documents that include, for example, information on coursework submission. Information in this study guide is maintained by Dr Chris Evans (chris.evans@brunel.ac.uk) Policy statements The Business School Student Handbook can be found on the Business School Blackboard Learn site (Academic Programme Office - APO). The Student Handbook is a useful source of information for all aspects of your studies, including policy, procedures, plagiarism, house style for assignments, joint and group work submissions and other important matters. The School assumes that you will familiarise yourself with this information, so you will need to look at these pages carefully at various times throughout your studies. The School also operates within the rules and regulations of the University more generally, and you should also look at what are known as 'Senate Regulations’ under the University’s webpages......

Words: 3877 - Pages: 16

Premium Essay

Study Guide

...Study guideMargaret Fuller, “The Great Lawsuit,” pp. 736-747: Study Guide/Discussion Forum questions F 10/12: No classes: faculty/staff meetings. Read: Fuller, intro (736-39), and “The Great Lawsuit” (739-747). Write: response to questions on Angel Discussion Forum #2 [questions below on this sheet, too]. Original post (your own response) due: 4 p.m. Second post (response to a classmate’s points) due 8 a.m. Monday. Discussion forum is instead of SRQ for Friday; we will meet in class on Monday to discuss it. M 10/15: In class: wrap-up of Fuller; beginning Thoreau. Read: Henry David Thoreau, intro (825-29) and “Resistance to Civil Government” (a.k.a. “Civil Disobedience,” 829-44). Please complete your response on the Fuller discussion forum by 8 a.m. and also write an SRQ on Thoreau’s “Civil Disobedience” essay. Use the note-taking guide to help with Thoreau’s essay. Questions on Fuller: First, a caution: Fuller uses names of many people who were famous in her day to illustrate her ideas. Don’t worry if you have no idea who these people are. The footnotes in the text are helpful, but the main thing to do is see what Fuller finds admirable (or not so admirable) about the people she mentions. Look at the values she seems to want readers to focus on. For the discussion forum, focus on question #1; if you want to discuss questions 2 and 3 in addition, great, but not required. We’ll discuss them in class on Monday. Question #1: On pages 739-44, Fuller......

Words: 530 - Pages: 3

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

Study Guide

...extended essay in order. Please note the order in which the elements are presented here is not the order in which they should be written. Title page Abstract Table of Contents Introduction Body (development/methods/results) Conclusion Bibliography Appendices Sample Title Page The title of an extended essay makes the focus of the essay clear. Be exact. The title does NOT need to be presented as a question. Research Question should follow title. The Marshall Plan’s Effects on the Beginnings of European Integration Research Question: To what extent and how did the Marshall Plan contribute to the beginnings of European integration (1947-1957)? Hillary Clinton 001518 - 000 International Baccalaureate Extended Essay History (field of study) May 2011 Sturgis Charter Public School Word Count: 3984 Abstract This page follows immediately after the title page. The abstract cannot be more than 300 words. The word count must be listed at the bottom of the page. The abstract is NOT an introduction and should be written last. The minimum requirements for the abstract are to state clearly: the research question being investigated the scope of the investigation the conclusions of the essay. The abstract may include all or some of the following features: A clear statement of the essay’s purpose and the research question. A statement of the thesis or argument and an explanation of the structure for the development of the thesis argument. The conclusions reached.......

Words: 986 - Pages: 4

Premium Essay

Study Guide

...Exam Study Guide Continues for 6 more pages » PDF View Text View Read full document Full access is free for premium users. Nutrition Final Exam Study Guide By hanxlee | April 2014 Zoom In Zoom Out Page 1 of 7 Final Exam Review NUTR 295 – Fall 2013 NEW MATERIAL: 100 points (~50 questions) Understanding Disease Risk Factors Describe the differences between a chronic disease and infectious disease. What leading causes of death are nutrition-related? A) heart diseases, cancers, strokes, diabetes Describe the concept of a risk factor. A) Factors known to be related to diseases, but have not yet proven to be a cause. We say that a certain factor puts us at increased risk for a disease, but does not cause it. How does one use risk factors? Review the basics of cardiovascular disease and atherosclerosis. Be ready to identify the risk factors for cardiovascular disease (especially diet-related risk factors!) A) High LDL blood cholesterol, low HDL blood cholesterol, high blood pressure (hypertension), diabetes, obesity (central obesity), physical inactivity, cigarette smoking, diet: high saturated or trans fats, low veggies, low fruits, low whole grains Describe the dietary strategies to reduce risk of CVD through diet. A) Decrease saturated and trans fat, increase soluble fiber intake, increase fruits and veggies, increase whole grains/ decrease refined grains, increase fish intake (2 servings/week) What is the TLC diet and what does it entail? A)......

Words: 614 - Pages: 3

Premium Essay

Study Guide

...Week One Student Guide The focus of the course is on understanding how research improves managerial decision making using five of the six stages in the research process. They include the following: • Stage 1: Clarifying the Research Question • Stage 2: Proposing the Research • Stage 3: Designing the Research Project • Stage 4: Data Collection and Interpretation • Stage 6: Reporting the Results Chapter 1 of Business Research Methods explains why people study business research and the importance of sound decision making. The goal is to enhance your understanding of the ethical dilemmas faced by managers and the roles and responsibilities of the researcher, sponsor, and participant as detailed in Chapter 2 of the text. The goal of ethics in research is to ensure that no one is harmed or suffers any adverse conditions posed by research activities. Important concepts include the right to privacy and quality and safety of participants. Many corporations, local and state governments, and the federal government have adopted a code of ethics with laws, policies, and procedures to regulate research on human beings. In Chapter 3, we find researchers have their own vocabulary and so we begin to learn important terminology needed to formulate sound research such as the difference between a construct, proposition and hypothesis followed by knowledge of various types of variables. In practice, variables represent an event, characteristic,......

Words: 646 - Pages: 3

Premium Essay

Study Guide

...MGT/311 – Final Exam Study Guide Created by ACCNerd.com How to Use this Study Guide – READ ME FIRST The following study guide will NOT have the same exact questions on your test! However, this study guide WILL help you ace the MGT/311 Final Exam. The guide covers the same topics and will help you gain a deeper understanding of the concepts. Best of all, you are guaranteed a score of 90% or higher or your money back! Tip #1: Use CRTL+F to search a related keyword to quickly find the topic you need. Tip #2: If a topic is missing, please email us at support@accnerd.com. We can usually provide immediate custom support during normal business hours. Remember to check out ACCNerd.com for the latest updates! 1.  Vera’s job in publishing requires her to seek out new writers. She has chosen a bunch of talented writers, but none of them seem to get chosen for publishing. She thinks this has something to do with conflicts in management. How would you describe Vera’s job attitude? Low job satisfaction. High job involvement Explanation: Vera obviously works very hard at her job, but she gets very little satisfaction because her writers never get published. 2.  Julia is a receptionist at a stockbroker’s office. Her boss just came in and chewed her out for no apparent reason. Julia freaks out and slams her iPad in the garbage. What is the cause of Julia’s reaction? Emotion Explanation: Julia was upset by her boss’s actions and let her emotions cause......

Words: 1656 - Pages: 7

Free Essay

Study Guide

...POL 140 – STUDY GUIDE *NOTE: Not everything on this study guide will be on the exam and not everything on the exam is on this study guide. This study guide is exactly that, a guide. 1) What is comparative politics? * Why do we study it? What does it allow us to do? * How is it distinct from international relations (IR)? * Explain the significant relationship between comparative politics and IR. Give an example. 2) What a hypothesis? * Give an example. 3) What is a dependent variable? * Give an example 4) What is an independent variable? * Give an example 5) What are the three methods used to test hypotheses in comparative political analysis? Be able to explain each and note the costs and benefits of each. 6) Know the difference between empirical and normative studies. 7) Know the distinctions between the three types of pre-colonial societies that we discussed in class. * Acephalous societies * State societies * Empires * Know the differences of each. Pay attention to the details. 8) Colonialism – Why was Europe successful in colonizing the non-Western world? 9) What was the Maxim Gun? * How was it different than earlier machine guns? * What impact did it have on European colonization? 10) Who were the big players? * Latin America * Asia * Africa * Describe “the scramble for Africa” 11) What are the three Gs? * Gold * The Age of......

Words: 727 - Pages: 3

Premium Essay

Study Guide

...Study Guide 1. Gravida-any pregnancy, regardless of duration, including present pregnancy. Para-birth after 20 weeks gestation regardless of whether the infant is born alive or dead. Gravida and Para-used in relationto pregnancies, not number of fetus. Nulligravida-a woman who has never been pregnant. Primigravda-a woman who is pregnant for the first time. Multigravida-a woman who is in her second or any subsequent pregnancy. Nullipara-a woman who has had no births at more than 20 weeks gestation. Primipara-a woman who has had one birth at more than 20 weeks gestation, regardless of whether the infant was born alive or dead. Multipara-a woman who has had 2 or more births at more than 20 weeks gestation. 1b. How are multiples accounted for? TWINS=1PREGNANCY 1 BIRTH 2. What is the GTPAL system? Gravida=number of pregnancy, Term=Infants born 37-42 weeks’ gestation, Preterm=Infants born 20-36 weeks’ gestation, Abortion=Pregnancies ending in either spontaneous or therapeutic abortion, Living=Number of living children 3. How long is pregnancy? Pregnancy last 40 weeks. 4. Explain Nagele’s rule for calculating the due date. Nagele’s rule: First day of LMP-3 months+7days 5. Describe antepartum uterine and fetal assessments: McDonald’s method-Measuring the distance in cm from the symphysis pubis to the top of the uterine fundus. Should correlate with the weeks gestation. Usually cm is less the last few weeks of pregnancy related to the baby dropping. ......

Words: 597 - Pages: 3

Premium Essay

Study Guide

...MEDIA EDUCATION FOUNDATION STUDY GUIDE NO LOGO BRANDS, GLOBALIZATION, RESISTANCE WRITTEN BY JEREMY EARP & DANIELLE DEVEREAUX Challenging media CONTENTS NO LOGO BRANDS, GLOBALIZATION, RESISTANCE NOTE TO TEACHERS.............................................................................................................................................................................pg. 03 THE MEDIA LITERACY CIRCLE OF EMPOWERMENT....................................................................................................................04 OVERVIEW.........................................................................................................................................................................................................05 PRE-VIEWING EXERCISES..........................................................................................................................................................................06 INTRODUCTION Key Points..........................................................................................................................................................................................................07 Questions for Discussion & Writing.....................................................................................................................................................07 NO SPACE: BRANDED WORLD Key Points......................................................................................

Words: 8621 - Pages: 35

Premium Essay

Study Guide

...Study Guide: Module 1 |I. Introduction |Instructions to Student: | | |Write your answers in this column. The cell will expand as you type. | |A. Core Christianity (textbook): “Introduction” | | | |How did the term “Christian” originate? | | | |For whom was this book written? | | | |Why do some have mistaken ideas about Christianity? | | |B. Theology for Today (online excerpt): Prolegomena to Theology | | | |What are the four tools for accurately arranging a systematic | | | |theology? | | | |What four...

Words: 382 - Pages: 2

Premium Essay

Study Guide

...that is external to the ERP system. Still, SAP has a strong accounting, HRIS, payroll, time keeping, and CRM components. Its standard database is on a SQL platform and operates in a Windows environment. SAP has traditionally been an on-site application and has only recently started to explore the software as a service (SaaS) market. As such, SAP cannot yet support cloud computing needs. 3. Infor – Infor is the third largest global ERP provider (behind SAP and Oracle) with over 70,000 customers; however, their focus is the manufacturing environment, not the professional services industry. Infor’s database is an MS SQL platform and operates in a Windows environment. It offers accounting, HRIS, payroll, distribution and manufacturing (e.g., bill of materials or kitting) components, yet lacks strong CRM capabilities and requires manual operations outside of the financial component to meet government cost accounting standards. It clumsily integrates with Hyperion. This ERP solution is considered to be more suited to middle market companies and may not be robust enough to fully handle the needs of ABC on a corporate wide basis. Currently ten percent (10%) of ABC sites use Infor. Infor yet support the SaaS market. 4. PeopleSoft – PeopleSoft is one of several ERP solutions offered by Oracle. Its database is on an MS SQL platform and it operates in a Windows environment. It offers accounting, HRIS, payroll, time keeping performance and CRM modules that are robust......

Words: 7227 - Pages: 29

Premium Essay

Study Guide

........................................................... 5 MODULE RELATED RESOURCES ...................................................................................................... 6 Prescribed book ................................................................................................................................. 6 Recommended books ........................................................................................................................ 6 Electronic Reserves (e-Reserves) ...................................................................................................... 6 STUDENT SUPPORT SERVICES FOR THE MODULE ........................................................................ 7 MODULE SPECIFIC STUDY PLAN ...................................................................................................... 7 MODULE PRACTICAL WORK AND WORK INTEGRATED LEARNING ............................................. 7 ASSESSMENT ...................................................................................................................................... 8 Assessment plan................................................................................................................................ 8 Year marks ........................................................................................................................................ 8 General assignment numbers ......................................................................

Words: 8325 - Pages: 34

Premium Essay

Study Guide

... ® OCA Oracle Database 11g: SQL Fundamentals I Exam Guide (Exam 1Z0-051) ABOUT THE AUTHORS John Watson (Oxford, UK) works for BPLC Management Consultants, teaching and consulting throughout Europe and Africa. He was with Oracle University for several years in South Africa, and before that worked for a number of companies, government departments, and NGOs in England and Europe. He is OCP qualified in both database and Application Server administration. John is the author of several books and numerous articles on technology and has 25 years of experience in IT. Roopesh Ramklass (South Africa), OCP, is an independent Oracle specialist with over 10 years of experience in a wide variety of IT environments. These include software design and development, systems analysis, courseware development, and lecturing. He has worked for Oracle Support and taught at Oracle University in South Africa for several years. Roopesh is experienced in managing and executing IT development projects, including infrastructure systems provisioning, software development, and systems integration. About the Technical Editor Bruce Swart (South Africa) works for 2Cana Solutions and has over 14 years of experience in IT. Whilst maintaining a keen interest for teaching others, he has performed several roles including developer, analyst, team leader, administrator, project manager, consultant, and lecturer. He is OCP qualified in both database and developer roles. He has taught at Oracle......

Words: 150089 - Pages: 601