Bug Catcher 1 Answer: Values!

Slides:



Advertisements
Similar presentations
Chapter 4 Joining Multiple Tables
Advertisements

For(int i = 1; i
6.830/6.814 Lecture 5 Database Internals Continued September 17, 2014.
CREATE LOGIN James WITH PASSWORD = 'A' Answer: SQL 2005 and 2008 can enforce the password policy of the operating system. CREATE LOGIN James WITH PASSWORD.
Cs3431 Constraints Sections 6.1 – 6.5. cs3431 Example CREATE TABLE Student ( sNum int, sName varchar (20), prof int, CONSTRAINT pk PRIMARY KEY (snum),
Access - 1 Table Query (View) FormReport Database Application Basic Database Objects Relationships among Access Database Objects A saved SELECT query is.
The XML data type in Microsoft SQL Server. The XML Type Microsoft SQL Server offers a special data type – XML – Used in tables, etc. – Basically a (long)
SQL Keys and Constraints Justin Maksim. Key Declaration Key constraint defined within the CREATE TABLE command Key can be declared using either the PRIMARY.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
Database Systems Lecture 5 Natasha Alechina
SQL Basics. SQL SQL (Structured Query Language) is a special-purpose programming language designed from managing data in relational database management.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
CS 160: Software Engineering October 6 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
Chapter 5 MYSQL Database. Introduction to MYSQL MySQL is the world's most popular open-source database. Open source means that the source code, the programming.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
CS146 References: ORACLE 9i PROGRAMMING A Primer Rajshekhar Sunderraman
Recap of SQL Lab no 8 Advance Database Management System.
SQL Basics. What is SQL? SQL stands for Structured Query Language. SQL lets you access and manipulate databases.
SQL Structured Query Language 1. Data Definition Language (DDL) is used to manage table and define data structure i.e. CREATE, ALTER, DROP Data Control.
Dec 8, 2003Murali Mani Constraints B term 2004: lecture 15.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
SQL John Nowobilski. What is SQL? Structured Query Language Manages Data in Database Management Systems based on the Relational Model Developed in 1970s.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) Relational Schema and SQL Queries James Wang.
There are two types of MySQL instructions (Data Definition Language) DDL: Create database, create table, alter table,,,. (Data Manipulation Language) DML.
Working with MySQL A290/A590, Fall /07/2014.
Table Structures and Indexing. The concept of indexing If you were asked to search for the name “Adam Wilbert” in a phonebook, you would go directly to.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
Catcher ugB BUG CATCHER GAME: Find the error in each slide then hit Enter 1.When you see the bug above click the mouse or hit [Enter]. 2.If you need to.
 MySQL  DDL ◦ Create ◦ Alter  DML ◦ Insert ◦ Select ◦ Update ◦ Delete  DDL(again) ◦ Drop ◦ Truncate.
IS232 Lab 9. CREATE USER Purpose: Use the CREATE USER statement to create and configure a database user, which is an account through which you can log.
3 A Guide to MySQL.
SQL, the Structured Query Language
Fundamentals of DBMS Notes-1.
PostgreSQL S511.
MySQL S511.
Insert, Update and the rest…
Basic Database Concepts
Instructor: Jason Carter
Referential Integrity MySQL
PHP + MySQL Commands Refresher.
Generalization.
ETL Processing Mechanics of ETL.
Lecturer: Mukhtar Mohamed Ali “Hakaale”
الأزنده أ.موضي المحرج.
Quiz About [Your topic]
Insert, Update, Delete Manipulating Data.
For student, require values for name and address.
HSCI 709 MySQL Lecture 13.
DATABASE SQL= Structure Query Language مبادئ قواعد بيانات
SQL Code for Byrnetube video
مقدمة في قواعد البيانات
Introduction To Structured Query Language (SQL)
PostgreSQL S511.
Rob Gleasure robgleasure.com
Data Management Innovations 2017 High level overview of DB
Christopher Thielen, Lead Application Developer, DSS IT
SQL pepper.
MySQL.
MySQL S511.
= x 2 = = 20 4 x 5 = = 16 4 x 4 = = 18 6 x 3 = = 12 2 x 6 = 12.
Instructor: Samia arshad
Turn on spool and save to file a.txt
កម្មវិធីបង្រៀន SQL Programming ជាភាសាខ្មែរ Online SQL Training Course
SQL NOT NULL Constraint
SQL AUTO INCREMENT Field
Presentation transcript:

Bug Catcher 1 Answer: Values! insert into tblMovie value(1,'Anaconda',105) insert into tblMovie value(2,'BraveHeart', 230) Answer: Values! insert into tblMovie values(1,'Anaconda',105) insert into tblMovie values(2,'BraveHeart', 230)

Bug Catcher 2 Answer: Update needs SET keyword. UPDATE tblMovie, m_title = 'Bonker Bonzo' WHERE m_id = 2 Answer: Update needs SET keyword. UPDATE tblMovie SET m_title = 'Bonker Bonzo' WHERE m_id = 2

Bug Catcher 3 Answer: WHERE and SET keywords are reversed. UPDATE tblMovie WHERE m_title = 'Bonker Bonzo' SET m_id = 2 Answer: WHERE and SET keywords are reversed. UPDATE tblMovie SET m_title = 'Bonker Bonzo' WHERE m_id = 2

Bug Catcher 4 UPDATE sd SET sd.UnitPriceDiscount = 0.1 FROM SalesOrderHeader sh WHERE sh.SalesPersonID = 275 Answer: The table you are updating must also be listed after the FROM clause. UPDATE sd SET sd.UnitPriceDiscount = 0.1 FROM SalesOrderHeader sh INNER JOIN SalesOrderDetail sd ON sd.SalesOrderID = sh.SalesOrderID WHERE sh.SalesPersonID = 275

Bug Catcher 5 Answer: Create table (Not database). CREATE DATABASE dbMovie GO USE dbMovie CREATE DATABASE tblMovie (m_Id int PRIMARY KEY, M_Title varchar(50) NOT NULL) Bug Catcher 5 Answer: Create table (Not database). CREATE TABLE tblMovie (m_Id int PRIMARY KEY, M_Title varchar(50) NOT NULL)

Bug Catcher 6 DROP needs to have DATABASE. No quotes after DATABASE (5 bugs) USE MASTER GO IF EXISTS(SELECT * FROM Sys.Sysdatabases WHERE [Name] = 'dbMovie') DROP 'dbMovies' GONE CREATE DATABASE dbMovies USE DATABASE dbMovies DROP needs to have DATABASE. No quotes after DATABASE USE should not have DATABASE keyword. GONE should be GO dbMovie vs dbMovies