Database. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc.

Size: px
Start display at page:

Download "Database. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc."

Transcription

1 Database Quiz with Explainations Hans-Petter Halvorsen, M.Sc.

2 Questions 1. What is a Database? 2. Give Examples of Systems that use a Database 3. What is DBMS? 4. Give Examples of DBMS systems? 5. We have 2 different types of Databases. Give also some Examples in each Category 6. What is an ER diagram? 7. Give examples of Database Design Tools? 8. Give Examples of Database Best practice 9. We have 4 different types of SQL Queries. Give also an example in each Category 10. What is a View, Stored Procedure and a Trigger?

3 What is a Database?

4 Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days are over.

5 Database Systems A database is an organized collection of data. A Database is a structured way to store lots of information. The information is stored in different tables. Everything today is stored in databases!

6 Give Examples of Systems that use a Database

7 Database Examples Bank/Account systems Information in Web pages such as Facebook, Wikipedia, YouTube, etc. Fronter, TimeEdit, etc. lots of other examples!

8 What is DBMS?

9 Database Management Systems (DBMS) A database management system (DBMS) is system software for creating and managing databases. The DBMS provides users and programmers with a systematic way to create, retrieve, update and manage data. A DBMS makes it possible for end users to create, read, update and delete data in a database. The DBMS essentially serves as an interface between the database and end users or application programs, ensuring that data is consistently organized and remains easily accessible.

10 Database Management Systems (DBMS) The DBMS manages three important things: the data, the database engine that allows data to be accessed, locked and modified and the database schema, which defines the database s logical structure.

11 Give Examples of DBMS systems?

12 Database Management Systems (DBMS) Microsoft SQL Server Enterprise, Developer versions, etc. (Professional use) Express version is free of charge Oracle MySQL (owned by Oracle, but previously owned by Sun Microsystems) - MySQL can be used free of charge (open source license), Web sites that use MySQL: YouTube, Wikipedia, Facebook Microsoft Access IBM DB2 Sybase MariaDB MongoDB etc.

13 We have 2 different types of Databases Which? Give also some Examples in each Category

14 Database Types Relation Database/SQL Databases Microsft SQL Server Oracle MySQL MariaDB etc. NoSQL Databases MongoDB etc.

15 What is an ER diagram?

16 Database Design ER Diagram ER Diagram (Entity-Relationship Diagram) Used for Design and Modeling of Databases. Specify Tables and relationship between them (Primary Keys and Foreign Keys) Example: Table Name Table Name Primary Key Primary Key Foreign Key Column Names Relational Database. In a relational database all the tables have one or more relation with each other using Primary Keys (PK) and Foreign Keys (FK). Note! You can only have one PK in a table, but you may have several FK s.

17 Table Name ER Diagram Example - Visio Primary Key (PK) Foreign Key (FK)

18

19 Give examples of Database Design Tools?

20 Database Design Tools Visio PowerDesigner CA ERwin CA ERwin Data Modeler Community Edition Community Edition is Free, 25 objects limit Support for Oracle, SQL Server, MySQL, ODBC, Sybase Toad Data Modeler A Simple designer is also included with SQL Server (physical model, not logical model)

21 Give Examples of Database Best practice

22 Database - Best Practice Tables: Use upper case and singular form in table names not plural, e.g., STUDENT (not students) Columns: Use Pascal notation, e.g., StudentId Primary Key: If the table name is COURSE, name the Primary Key column CourseId, etc. Always use Integer and Identity(1,1) for Primary Keys. Use UNIQUE constraint for other columns that needs to be unique, e.g. RoomNumber Specify Required Columns (NOT NULL) i.e., which columns that need to have data or not Standardize on few/these Data Types: int, float, varchar(x), datetime, bit Use English for table and column names Avoid abbreviations! (Use RoomNumber not RoomNo, RoomNr,...)

23 We have 4 different types of SQL Queries. Give also an example in each Category

24 SQL Structured Query language A Database Computer Language designed for Managing Data in Relational Database Management Systems (RDBMS) Query Examples: insert into STUDENT (Name, Number, SchoolId) values ('John Smith', '100005', 1) select SchoolId, Name from SCHOOL select * from SCHOOL where SchoolId > 100 update STUDENT set Name='John Wayne' where StudentId=2 delete from STUDENT where SchoolId=3 We have 4 different Query Types (CRUD): INSERT, SELECT, UPDATE anddelete CRUD Create (Insert), Read (Select), Update and Delete

25 What is a View, Stored Procedure and a Trigger?

26 A View is a virtual table that can contain data from multiple tables A Stored Procedure is like Method in C# - it is a piece of code with SQL commands that do a specific task and you reuse it A Trigger is executed when you insert, update or delete data in a Table specified in the Trigger.

27 Create View: IF EXISTS (SELECT name FROM sysobjects WHERE name = 'CourseData' AND type = 'V') DROP VIEW CourseData GO Creating Views using SQL A View is a virtual table that can contain data from multiple tables The Name of the View CREATE VIEW CourseData AS SELECT SCHOOL.SchoolId, SCHOOL.SchoolName, COURSE.CourseId, COURSE.CourseName, COURSE.Description FROM SCHOOL INNER JOIN COURSE ON SCHOOL.SchoolId = COURSE.SchoolId GO Using the View: select * from CourseData Inside the View you join the different tables together using the JOIN operator You can Use the View as an ordinary table in Queries : 27

28 Create Stored Procedure: IF EXISTS (SELECT name FROM sysobjects WHERE name = 'StudentGrade' AND type = 'P') DROP PROCEDURE StudentGrade OG CREATE PROCEDURE varchar(1) AS Stored Procedure A Stored Procedure is like Method in C# - it is a piece of code with SQL commands that do a specific task and you reuse it Procedure Name Input Arguments int select StudentId from STUDENT where StudentName Internal/Local Variables Note! Each variable starts select CourseId from COURSE where CourseName insert into GRADE (StudentId, CourseId, Grade) GO Using the Stored Procedure: execute StudentGrade 'John Wayne', 'SCE2006', 'B' SQL Code (the body of the Stored Procedure)

29 IF EXISTS (SELECT name FROM sysobjects WHERE name = 'CalcAvgGrade' AND type = 'TR') DROP TRIGGER CalgAvgGrade GO CREATE TRIGGER CalcAvgGrade ON GRADE FOR UPDATE, INSERT, DELETE AS float = StudentId from INSERTED Trigger A Trigger is executed when you insert, update or delete data in a Table specified in the Trigger. Create the Trigger: = AVG(Grade) from GRADE where StudentId update STUDENT set TotalGrade where StudentId GO Name of the Trigger Specify which Table the Trigger shall work on Specify what kind of operations the Trigger shall act on Internal/Local Variables Inside the Trigger you can use ordinary SQL statements, create variables, etc. Note! INSERTED is a temporarily table containing the latest inserted data, and it is very handy to use inside a trigger SQL Code (The body of the Trigger)

30 References Software Development - A Practical Approach Halvorsen, Hans-Petter, 2015 Essentials of Software Engineering Frank Tsui; Orlando Karam; Barbara Bernal, 3 ed., Jones & Bartlett Learning Software Engineering I. Sommerville, 10 ed.: Pearson, 2015 Software Engineering. Modern Approaches E. J. Braude and M. E.Bernstein, 2 ed.: Wiley, 2011.

31

32 Hans-Petter Halvorsen, M.Sc. University College of Southeast Norway Blog:

Database Systems. S. Adams. Dilbert. Available: Hans-Petter Halvorsen

Database Systems. S. Adams. Dilbert. Available:  Hans-Petter Halvorsen Database Systems S. Adams. Dilbert. Available: http://dilbert.com Hans-Petter Halvorsen Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies

More information

SQL Server and SQL Structured Query Language

SQL Server and SQL Structured Query Language SQL Server and SQL Structured Query Language Step by step Exercises Hans-Petter Halvorsen Database Systems Hans-Petter Halvorsen, M.Sc. Database Systems A Database is a structured way to store lots of

More information

Database Views & Stored Procedures. Hans-Petter Halvorsen, M.Sc.

Database Views & Stored Procedures. Hans-Petter Halvorsen, M.Sc. Database Views & Stored Procedures Hans-Petter Halvorsen, M.Sc. SQL Server Hans-Petter Halvorsen, M.Sc. Microsoft SQL Server 3 1 2 Your SQL Server Your Tables Your Database 4 Write your Query here 5 The

More information

Introduction to ERwin

Introduction to ERwin Introduction to ERwin Database Design & Modelling Hans-Petter Halvorsen, M.Sc. Software The following Editions can be downloaded for Free on Internet: CA ERwin Data Modeler Community Edition SQL Server

More information

Database Lab. Hans-Petter Halvorsen

Database Lab.  Hans-Petter Halvorsen 2017.03.24 Database Lab http://home.hit.no/~hansha/?lab=database Hans-Petter Halvorsen Lab Overview Database Design & Modelling SQL Server Management Studio Create Tables Database Management Microsoft

More information

Database Overview. Introduction to Database Systems, ERwin, SQL Server, SQL, etc. Hans-Petter Halvorsen, M.Sc.

Database Overview. Introduction to Database Systems, ERwin, SQL Server, SQL, etc. Hans-Petter Halvorsen, M.Sc. Database Overview Introduction to Database Systems, ERwin, SQL Server, SQL, etc. Hans-Petter Halvorsen, M.Sc. Contents Database Modelling/Design using ERwin Generate SQL Table Script using ERwin Generate

More information

Software Platforms. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc.

Software Platforms. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc. Software Platforms Quiz with Explainations Hans-Petter Halvorsen, M.Sc. Questions 1. List 3 different software platforms with some examples for each 2. List 5 different Web Browsers and the name of the

More information

UML. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc.

UML. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc. UML Quiz with Explainations Hans-Petter Halvorsen, M.Sc. Questions 1. What is UML? 2. What is an ER diagram? 3. Give example of some types of UML diagrams (in total we have 14 different types) 4. Give

More information

Structured Query Language

Structured Query Language University College of Southeast Norway Structured Query Language Hans-Petter Halvorsen, 2016.01.08 The Tutorial is available Online: http://home.hit.no/~hansha/?tutorial=sql http://home.hit.no/~hansha

More information

Unit Testing. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc.

Unit Testing. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc. Unit Testing Quiz with Explainations Hans-Petter Halvorsen, M.Sc. Questions 1. What is Unit Testing? 2. List some Unit Test Framework 3. Who is creating the Unit Tests? 4. What kind of Requirements does

More information

https://www.halvorsen.blog Industrial IT Laboratory Work https://www.halvorsen.blog/documents/teaching/courses/industrialit Hans-Petter Halvorsen

https://www.halvorsen.blog Industrial IT Laboratory Work https://www.halvorsen.blog/documents/teaching/courses/industrialit Hans-Petter Halvorsen https://www.halvorsen.blog Industrial IT Laboratory Work https://www.halvorsen.blog/documents/teaching/courses/industrialit Hans-Petter Halvorsen OPC Laboratory Work The Industrial IT course contains different

More information

Software Architecture

Software Architecture Software Architecture Quiz with Explainations Hans-Petter Halvorsen, M.Sc. Questions 1. Explain 3-layer Architecture 2. What is a Web Service? 3. What is SOA? 4. What is an API? 5. What is Client-Server

More information

Software Documentation

Software Documentation Software Documentation Quiz with Explainations Hans-Petter Halvorsen, M.Sc. Questions 1. List 4 important Process Documents 2. What are the main Software Documentation Categories? 3. What is SRS? 4. What

More information

Software Implementation

Software Implementation Software Implementation Quiz with Explainations Hans-Petter Halvorsen, M.Sc. Questions 1. List 10 different Programming Languages 2. What is an IDE? - Give some Examples 3. What is.net? 4. What is ASP.NET?

More information

Source Code Control. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc.

Source Code Control. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc. Source Code Control Quiz with Explainations Hans-Petter Halvorsen, M.Sc. Questions 1. What is SCC? 2. List at least 5 different SSC Systems 3. Why do we need a SCC/Version Control System? 4. What is Distributed

More information

University College of Southeast Norway. Introduction to Database. Systems. Hans-Petter Halvorsen,

University College of Southeast Norway. Introduction to Database. Systems. Hans-Petter Halvorsen, University College of Southeast Norway Introduction to Database Hans-Petter Halvorsen, 2016.11.01 Systems http://home.hit.no/~hansha Preface This document explains the basic concepts of a database system

More information

Software Testing. Hans-Petter Halvorsen, M.Sc.

Software Testing. Hans-Petter Halvorsen, M.Sc. Software Testing Hans-Petter Halvorsen, M.Sc. STD System Documentation Testing Software Test Documentation Software Test Plan (STP) Test Documentation End-User Documentation Implementation Code System

More information

Using SQL Server in C#

Using SQL Server in C# University College of Southeast Norway Using SQL Server in C# Hans-Petter Halvorsen, 2016.11.01 with Examples http://home.hit.no/~hansha Table of Contents 1. Introduction...

More information

Databases CSCI 201 Principles of Software Development

Databases CSCI 201 Principles of Software Development Databases CSCI 201 Principles of Software Development Jeffrey Miller, Ph.D. jeffrey.miller@usc.edu Outline Databases SQL Try It! USC CSCI 201L Databases Database systems store data and provide a means

More information

University College of Southeast Norway ASP.NET. Web Programming. Hans-Petter Halvorsen,

University College of Southeast Norway ASP.NET. Web Programming. Hans-Petter Halvorsen, University College of Southeast Norway Hans-Petter Halvorsen, 2016.11.01 ASP.NET Web Programming http://home.hit.no/~hansha Table of Contents 1 Introduction... 4 1.1 Visual Studio... 4 1.2 C#... 5 1.3.NET

More information

Software Architecture

Software Architecture O. Widder. (2013). geek&poke. Available: http://geek-and-poke.com Software Architecture Hans-Petter Halvorsen Clients Windows Server 2008/2012 Windows 7/8 Wi-Fi Server LAN Ethernet OPC Server Router Web

More information

Create a Virtual Test Environment

Create a Virtual Test Environment Create a Virtual Test Environment Step by Step Exercises Hans-Petter Halvorsen, M.Sc. Why Do We Need a Test Environment? Why cant we just use our own PC? Why Test Environment? It works on my PC says the

More information

A practical introduction to database design

A practical introduction to database design A practical introduction to database design Dr. Chris Tomlinson Bioinformatics Data Science Group, Room 126, Sir Alexander Fleming Building chris.tomlinson@imperial.ac.uk Computer Skills Classes 17/01/19

More information

Week Assignment. Software Testing Test Planning. Hans-Petter Halvorsen

Week Assignment. Software Testing Test Planning. Hans-Petter Halvorsen 2017.04.07 Week Assignment Software Testing Test Planning B. Lund. Lunch. Available: http://www.lunchstriper.no, http://www.dagbladet.no/tegneserie/lunch/ Hans-Petter Halvorsen Note! All Documents, Code,

More information

Working with Databases and Java

Working with Databases and Java Working with Databases and Java Pedro Contreras Department of Computer Science Royal Holloway, University of London January 30, 2008 Outline Introduction to relational databases Introduction to Structured

More information

SQL language. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c)

SQL language. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c) SQL language Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c) 2011-2016 SQL - Structured Query Language SQL is a computer language for communicating with DBSM Nonprocedural (declarative) language What

More information

Data Modeling Diagram Open Source Tool Oracle

Data Modeling Diagram Open Source Tool Oracle Data Modeling Diagram Open Source Tool Oracle Data Model Diagram Visualizer. in the original source tool. Figure 3 of SPARC International, Inc. UNIX is a registered trademark licensed through X/Open. Navicat

More information

From business need to implementation Design the right information solution

From business need to implementation Design the right information solution From business need to implementation Design the right information solution Davor Gornik (dgornik@us.ibm.com) Product Manager Agenda Relational design Integration design Summary Relational design Data modeling

More information

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data. Managing Data Data storage tool must provide the following features: Data definition (data structuring) Data entry (to add new data) Data editing (to change existing data) Querying (a means of extracting

More information

The Relational Model. Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC)

The Relational Model. Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC) The Relational Model Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC) Why Study the Relational Model? Most widely used model in Commercial DBMSs: Vendors: IBM, Microsoft,

More information

Consistency The DBMS must ensure the database will always be in a consistent state. Whenever data is modified, the database will change from one

Consistency The DBMS must ensure the database will always be in a consistent state. Whenever data is modified, the database will change from one Data Management We start our studies of Computer Science with the problem of data storage and organization. Nowadays, we are inundated by data from all over. To name a few data sources in our lives, we

More information

SCADA Lab. Supervisory Control and Data Acquisition. Hans-Petter Halvorsen

SCADA Lab. Supervisory Control and Data Acquisition.   Hans-Petter Halvorsen 2017.04.18 SCADA Lab Supervisory Control and Data Acquisition http://home.hit.no/~hansha/?lab=scada Hans-Petter Halvorsen Lab Overview In this Lab we will create a SCADA System from scratch Air Heater

More information

Networks and Web for Health Informatics (HINF 6220)

Networks and Web for Health Informatics (HINF 6220) Networks and Web for Health Informatics (HINF 6220) Tutorial #1 Raheleh Makki Email: niri@cs.dal.ca Tutorial Class Timings Tuesday & Thursday 4:05 5:25 PM Course Outline Database Web Programming SQL PHP

More information

MySQL. A practical introduction to database design

MySQL. A practical introduction to database design MySQL A practical introduction to database design Dr. Chris Tomlinson Bioinformatics Data Science Group, Room 126, Sir Alexander Fleming Building chris.tomlinson@imperial.ac.uk Database Classes 24/09/18

More information

CS143: Relational Model

CS143: Relational Model CS143: Relational Model Book Chapters (4th) Chapters 1.3-5, 3.1, 4.11 (5th) Chapters 1.3-7, 2.1, 3.1-2, 4.1 (6th) Chapters 1.3-6, 2.105, 3.1-2, 4.5 Things to Learn Data model Relational model Database

More information

Team Assignment. Final Software Delivery. IA4412 Software Engineering

Team Assignment. Final Software Delivery. IA4412 Software Engineering IA4412 Software Engineering Team Assignment Final Software Delivery B. Lund. Lunch. Available: http://www.lunchstriper.no, http://www.dagbladet.no/tegneserie/lunch/ Hans-Petter Halvorsen, M.Sc. Level of

More information

The appendix contains information about the Classic Models database. Place your answers on the examination paper and any additional paper used.

The appendix contains information about the Classic Models database. Place your answers on the examination paper and any additional paper used. Name: Student Number: Instructions: Do all 9 questions. There is a total of 87 marks. The appendix contains information about the Classic Models database. Place your answers on the examination paper and

More information

A hypothetical M:M student schedule example

A hypothetical M:M student schedule example A hypothetical : student schedule example We are interested in creating a relationship between two tables: Student and Class Section. We want to be able to be able to have students register for different

More information

CSC 453 Database Technologies. Tanu Malik DePaul University

CSC 453 Database Technologies. Tanu Malik DePaul University CSC 453 Database Technologies Tanu Malik DePaul University A Data Model A notation for describing data or information. Consists of mostly 3 parts: Structure of the data Data structures and relationships

More information

CSC 355 Database Systems

CSC 355 Database Systems CSC 355 Database Systems Marcus Schaefer Databases? Database 1. DB models aspects of the real world (miniworld, universe of discourse) 2. Collection of data logically coherent Meaningful Information 3.

More information

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

The Relational Model. Why Study the Relational Model? Relational Database: Definitions The Relational Model Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Why Study the Relational Model? Most widely used model. Vendors: IBM, Microsoft, Oracle, Sybase, etc. Legacy systems in

More information

Simulation in LabVIEW. Hans-Petter Halvorsen, M.Sc.

Simulation in LabVIEW. Hans-Petter Halvorsen, M.Sc. Simulation in LabVIEW Hans-Petter Halvorsen, M.Sc. Software LabVIEW LabVIEW Control Design and Simulation Module This module is used for creating Control and Simulation applications with LabVIEW. Here

More information

Team Foundation Server Visual Studio Team Services. Hans-Petter Halvorsen, M.Sc.

Team Foundation Server Visual Studio Team Services. Hans-Petter Halvorsen, M.Sc. Team Foundation Server Visual Studio Team Services Hans-Petter Halvorsen, M.Sc. Team Foundation Server (TFS) is an Application Lifecycle Management (ALM) system The Software Development Lifecycle (SDLC)

More information

Introduction to Data Management. Lecture #4 (E-R Relational Translation)

Introduction to Data Management. Lecture #4 (E-R Relational Translation) Introduction to Data Management Lecture #4 (E-R Relational Translation) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements v Today

More information

CGS 3066: Spring 2017 SQL Reference

CGS 3066: Spring 2017 SQL Reference CGS 3066: Spring 2017 SQL Reference Can also be used as a study guide. Only covers topics discussed in class. This is by no means a complete guide to SQL. Database accounts are being set up for all students

More information

In This Lecture. SQL Data Definition SQL SQL. Non-Procedural Programming. Notes. Database Systems Lecture 5 Natasha Alechina

In This Lecture. SQL Data Definition SQL SQL. Non-Procedural Programming. Notes. Database Systems Lecture 5 Natasha Alechina This Lecture Database Systems Lecture 5 Natasha Alechina The language, the relational model, and E/R diagrams CREATE TABLE Columns Primary Keys Foreign Keys For more information Connolly and Begg chapter

More information

Databases: Introduction

Databases: Introduction Introduction Data Databases: Introduction P.J. McBrien Imperial College London P.J. McBrien (Imperial College London) Databases: Introduction 1 / 23 Introduction Data Models Databases are Computer Stores

More information

Physical Design of Relational Databases

Physical Design of Relational Databases Physical Design of Relational Databases Chapter 8 Class 06: Physical Design of Relational Databases 1 Physical Database Design After completion of logical database design, the next phase is the design

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems Lecture 3 Relational Model & Languages Part-1 September 7, 2018 Sam Siewert More Embedded Systems Summer - Analog, Digital, Firmware, Software Reasons to Consider Catch

More information

The University of Nottingham

The University of Nottingham The University of Nottingham SCHOOL OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY A LEVEL 1 MODULE, SPRING SEMESTER 2006-2007 DATABASE SYSTEMS Time allowed TWO hours Candidates must NOT start writing

More information

COMP 430 Intro. to Database Systems. Encapsulating SQL code

COMP 430 Intro. to Database Systems. Encapsulating SQL code COMP 430 Intro. to Database Systems Encapsulating SQL code Want to bundle SQL into code blocks Like in every other language Encapsulation Abstraction Code reuse Maintenance DB- or application-level? DB:

More information

Visual Studio Team Services

Visual Studio Team Services Visual Studio Team Services Getting Started Hans-Petter Halvorsen, M.Sc. Visual Studio Team Services Visual Studio Team Services is a platform taking care of all aspects of the process of developing software

More information

UNIVERSITY OF BOLTON WESTERN INTERNATIONAL COLLEGE FZE BSC (HONS) COMPUTING SEMESTER ONE EXAMINATION 2015/2016 DATABASE THEORY AND PRACTICE

UNIVERSITY OF BOLTON WESTERN INTERNATIONAL COLLEGE FZE BSC (HONS) COMPUTING SEMESTER ONE EXAMINATION 2015/2016 DATABASE THEORY AND PRACTICE OCD52 UNIVERSITY OF BOLTON WESTERN INTERNATIONAL COLLEGE FZE BSC (HONS) COMPUTING SEMESTER ONE EXAMINATION 2015/2016 DATABASE THEORY AND PRACTICE MODULE NO: CPU5002 Date: Wednesday, 13 January 2016 Time:

More information

The Relational Model. Chapter 3

The Relational Model. Chapter 3 The Relational Model Chapter 3 Why Study the Relational Model? Most widely used model. Systems: IBM DB2, Informix, Microsoft (Access and SQL Server), Oracle, Sybase, MySQL, etc. Legacy systems in older

More information

Introduction to MySQL /MariaDB and SQL Basics. Read Chapter 3!

Introduction to MySQL /MariaDB and SQL Basics. Read Chapter 3! Introduction to MySQL /MariaDB and SQL Basics Read Chapter 3! http://dev.mysql.com/doc/refman/ https://mariadb.com/kb/en/the-mariadb-library/documentation/ MySQL / MariaDB 1 College Database E-R Diagram

More information

Score. 1 (10) 2 (10) 3 (8) 4 (13) 5 (9) Total (50)

Score. 1 (10) 2 (10) 3 (8) 4 (13) 5 (9) Total (50) Student number: Signature: UNIVERSITY OF VICTORIA Faculty of Engineering Department of Computer Science CSC 370 (Database Systems) Instructor: Daniel M. German Midterm 18 June 2003 Duration: 75 minutes

More information

CS127 Homework #3. Due: October 11th, :59 P.M. Consider the following set of functional dependencies, F, for the schema R(A, B, C, D, E)

CS127 Homework #3. Due: October 11th, :59 P.M. Consider the following set of functional dependencies, F, for the schema R(A, B, C, D, E) CS127 Homework #3 Warmup #1 Consider the following set of functional dependencies, F, for the schema R(A, B, C, D, E) 1. Find the candidate keys for the schema R. AB, C, D, and EA 2. Compute the closure,

More information

Oral Questions and Answers (DBMS LAB) Questions & Answers- DBMS

Oral Questions and Answers (DBMS LAB) Questions & Answers- DBMS Questions & Answers- DBMS https://career.guru99.com/top-50-database-interview-questions/ 1) Define Database. A prearranged collection of figures known as data is called database. 2) What is DBMS? Database

More information

University College of Southeast Norway. Database Communication. in LabVIEW. Hans-Petter Halvorsen,

University College of Southeast Norway. Database Communication. in LabVIEW. Hans-Petter Halvorsen, University College of Southeast Norway Database Communication Hans-Petter Halvorsen, 2016.10.31 in LabVIEW http://home.hit.no/~hansha Preface This document explains the basic concepts of a database system

More information

Where is Database Management System (DBMS) being Used?

Where is Database Management System (DBMS) being Used? The main objective of DBMS (Database Management System) is to provide a structured way to store and retrieve information that is both convenient and efficient. By data, we mean known facts that can be

More information

CMPE 131 Software Engineering. Database Introduction

CMPE 131 Software Engineering. Database Introduction Presented By Melvin Ch ng CMPE 131 Software Engineering September 14, 2017 Database Introduction Ruby on Rails ORM Agenda Database Management System (DBMS) SQL vs NoSQL Relational Database Introduction

More information

What is database? Types and Examples

What is database? Types and Examples What is database? Types and Examples Visit our site for more information: www.examplanning.com Facebook Page: https://www.facebook.com/examplanning10/ Twitter: https://twitter.com/examplanning10 TABLE

More information

Get Table Schema In Sql Server 2008 To Add Column If Not Exists >>>CLICK HERE<<<

Get Table Schema In Sql Server 2008 To Add Column If Not Exists >>>CLICK HERE<<< Get Table Schema In Sql Server 2008 To Add Column If Not Exists IF NOT EXISTS ( SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'(dbo). Also try catch is easily possible to use in sql serverand

More information

Database Management Systems,

Database Management Systems, Database Management Systems SQL Query Language (1) 1 Topics Introduction SQL History Domain Definition Elementary Domains User-defined Domains Creating Tables Constraint Definition INSERT Query SELECT

More information

Informatics 1: Data & Analysis

Informatics 1: Data & Analysis Informatics 1: Data & Analysis Lecture 3: The Relational Model Ian Stark School of Informatics The University of Edinburgh Tuesday 24 January 2017 Semester 2 Week 2 https://blog.inf.ed.ac.uk/da17 Lecture

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems http://dilbert.com/strips/comic/1995-10-11/ Lecture 5 More SQL and Intro to Stored Procedures September 24, 2017 Sam Siewert SQL Theory and Standards Completion of SQL in

More information

ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION

ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION JING YANG 2010 FALL Class 3: The Relational Data Model and Relational Database Constraints Outline 2 The Relational Data Model and Relational Database Constraints

More information

Chapter 3: Introduction to SQL. Chapter 3: Introduction to SQL

Chapter 3: Introduction to SQL. Chapter 3: Introduction to SQL Chapter 3: Introduction to SQL Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 3: Introduction to SQL Overview of The SQL Query Language Data Definition Basic Query

More information

SQL: Part II. Announcements (September 18) Incomplete information. CPS 116 Introduction to Database Systems. Homework #1 due today (11:59pm)

SQL: Part II. Announcements (September 18) Incomplete information. CPS 116 Introduction to Database Systems. Homework #1 due today (11:59pm) SQL: Part II CPS 116 Introduction to Database Systems Announcements (September 18) 2 Homework #1 due today (11:59pm) Submit in class, slide underneath my office door Sample solution available Thursday

More information

EE221 Databases Practicals Manual

EE221 Databases Practicals Manual EE221 Databases Practicals Manual Lab 1 An Introduction to SQL Lab 2 Database Creation and Querying using SQL Assignment Data Analysis, Database Design, Implementation and Relation Normalisation School

More information

CSE 344 AUGUST 1 ST ENTITIES

CSE 344 AUGUST 1 ST ENTITIES CSE 344 AUGUST 1 ST ENTITIES EXAMS Will hand back after class Quartiles 1 0 67 2 68 74 3 74 82 4 82 100 (no one actually got 0 or 100) ADMINISTRIVIA HW6 due Wednesday Spark SQL interface much easier to

More information

Informatics 1: Data & Analysis

Informatics 1: Data & Analysis Informatics 1: Data & Analysis Lecture 7: SQL Ian Stark School of Informatics The University of Edinburgh Tuesday 4 February 2014 Semester 2 Week 4 http://www.inf.ed.ac.uk/teaching/courses/inf1/da Careers

More information

CSE 544 Principles of Database Management Systems

CSE 544 Principles of Database Management Systems CSE 544 Principles of Database Management Systems Lecture 1 - Introduction and the Relational Model 1 Outline Introduction Class overview Why database management systems (DBMS)? The relational model 2

More information

Relational Model. Topics. Relational Model. Why Study the Relational Model? Linda Wu (CMPT )

Relational Model. Topics. Relational Model. Why Study the Relational Model? Linda Wu (CMPT ) Topics Relational Model Linda Wu Relational model SQL language Integrity constraints ER to relational Views (CMPT 354 2004-2) Chapter 3 CMPT 354 2004-2 2 Why Study the Relational Model? Most widely used

More information

Today Learning outcomes LO2

Today Learning outcomes LO2 2015 2016 Phil Smith Today Learning outcomes LO2 On successful completion of this unit you will: 1. Be able to design and implement relational database systems. 2. Requirements. 3. User Interface. I am

More information

UML. Unified Modeling Language. Hans-Petter Halvorsen, M.Sc. O. Widder. (2013). geek&poke. Available:

UML. Unified Modeling Language. Hans-Petter Halvorsen, M.Sc. O. Widder. (2013). geek&poke. Available: O. Widder. (2013). geek&poke. Available: http://geek-and-poke.com UML Unified Modeling Language Hans-Petter Halvorsen, M.Sc. Unified Modeling Language (UML) Examples Class Diagram Use Case Diagram 2 Deployment

More information

SQL Data Definition Language: Create and Change the Database Ray Lockwood

SQL Data Definition Language: Create and Change the Database Ray Lockwood Introductory SQL SQL Data Definition Language: Create and Change the Database Pg 1 SQL Data Definition Language: Create and Change the Database Ray Lockwood Points: DDL statements create and alter the

More information

Where Are We? Next Few Lectures. Integrity Constraints Motivation. Constraints in E/R Diagrams. Keys in E/R Diagrams

Where Are We? Next Few Lectures. Integrity Constraints Motivation. Constraints in E/R Diagrams. Keys in E/R Diagrams Where Are We? Introduction to Data Management CSE 344 Lecture 15: Constraints We know quite a bit about using a DBMS Start with real-world problem, design ER diagram From ER diagram to relations -> conceptual

More information

Create a simple database with MySQL

Create a simple database with MySQL Create a simple database with MySQL 1.Connect the MySQL server through MySQL Workbench You can achieve many database operations by typing the SQL langue into the Query panel, such as creating a database,

More information

DATABASES SQL INFOTEK SOLUTIONS TEAM

DATABASES SQL INFOTEK SOLUTIONS TEAM DATABASES SQL INFOTEK SOLUTIONS TEAM TRAINING@INFOTEK-SOLUTIONS.COM Databases 1. Introduction in databases 2. Relational databases (SQL databases) 3. Database management system (DBMS) 4. Database design

More information

Informatics 1: Data & Analysis

Informatics 1: Data & Analysis Informatics 1: Data & Analysis Lecture 7: SQL Ian Stark School of Informatics The University of Edinburgh Tuesday 3 February 2015 Semester 2 Week 4 http://www.inf.ed.ac.uk/teaching/courses/inf1/da Careers

More information

Relational Database Systems Part 01. Karine Reis Ferreira

Relational Database Systems Part 01. Karine Reis Ferreira Relational Database Systems Part 01 Karine Reis Ferreira karine@dpi.inpe.br Aula da disciplina Computação Aplicada I (CAP 241) 2016 Database System Database: is a collection of related data. represents

More information

Introduction to Database Systems CSE 414

Introduction to Database Systems CSE 414 Introduction to Database Systems CSE 414 Lecture 16: Constraints CSE 414 - Spring 2015 1 Announcements Reminders: Web quiz due Monday night XML homework due Wednesday night Today: Constraints (7.1, 7.2,

More information

Introduction to Data Management CSE 344

Introduction to Data Management CSE 344 Introduction to Data Management CSE 344 Lecture 16: Constraints CSE 344 - Fall 2014 1 Announcements Sections tomorrow: XML. Quiz and next HW on XML posted soon, due next week after midterm HW 4 due tomorrow

More information

The Relational Model. Chapter 3. Database Management Systems, R. Ramakrishnan and J. Gehrke 1

The Relational Model. Chapter 3. Database Management Systems, R. Ramakrishnan and J. Gehrke 1 The Relational Model Chapter 3 Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Why Study the Relational Model? Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc.

More information

BIS Database Management Systems.

BIS Database Management Systems. BIS 512 - Database Management Systems http://www.mis.boun.edu.tr/durahim/ Ahmet Onur Durahim Learning Objectives Database systems concepts Designing and implementing a database application Life of a Query

More information

MIS Database Systems.

MIS Database Systems. MIS 335 - Database Systems http://www.mis.boun.edu.tr/durahim/ Ahmet Onur Durahim Learning Objectives Database systems concepts Designing and implementing a database application Life of a Query in a Database

More information

Part I: Introduction. Outline. Introduction to Databases & SQL. Motivating Example Flat Files. Relational Databases. Problems with Flat Files

Part I: Introduction. Outline. Introduction to Databases & SQL. Motivating Example Flat Files. Relational Databases. Problems with Flat Files Outline Introduction to Databases & SQL Dr. Christopher M. Bourke cbourke@cse.unl.edu 1. Introduction 2. Creating Tables 3. Manipulating Data 4. Querying Data 5. Extended Demonstration 6. Designing Databases

More information

CS 327E Lecture 5. Shirley Cohen. February 8, 2016

CS 327E Lecture 5. Shirley Cohen. February 8, 2016 CS 327E Lecture 5 Shirley Cohen February 8, 2016 Agenda Readings for today Reading Quiz Concept Questions Homework for next time Homework for Today Chapter 10 from the Learning SQL book Exercises at the

More information

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010 CS403- Database Management Systems Solved MCQS From Midterm Papers April 29,2012 MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 CS403- Database Management Systems MIDTERM EXAMINATION - Spring

More information

Database Systems. Bence Molnár

Database Systems. Bence Molnár Database Systems Bence Molnár SQL History Beginning of 70s IBM SEQUEL (Structured English QUery Language) Structured/Standard Query Language In 1986 ANSI, 1987 ISO standard SQL2 ('92), SQL3 ('99),... Development

More information

MongoDB and Mysql: Which one is a better fit for me? Room 204-2:20PM-3:10PM

MongoDB and Mysql: Which one is a better fit for me? Room 204-2:20PM-3:10PM MongoDB and Mysql: Which one is a better fit for me? Room 204-2:20PM-3:10PM About us Adamo Tonete MongoDB Support Engineer Agustín Gallego MySQL Support Engineer Agenda What are MongoDB and MySQL; NoSQL

More information

Database Management Systems,

Database Management Systems, Database Management Systems Database Design (2) 1 Topics Data Base Design Logical Design (Review) Physical Design Entity Relationship (ER) Model to Relational Model Entity Relationship Attributes Normalization

More information

Chapter 3: Introduction to SQL

Chapter 3: Introduction to SQL Chapter 3: Introduction to SQL Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 3: Introduction to SQL Overview of the SQL Query Language Data Definition Basic Query

More information

Instructor: Craig Duckett. Lecture 02: Thursday, March 29 th, 2018 SQL Basics and SELECT, FROM, WHERE

Instructor: Craig Duckett. Lecture 02: Thursday, March 29 th, 2018 SQL Basics and SELECT, FROM, WHERE Instructor: Craig Duckett Lecture 02: Thursday, March 29 th, 2018 SQL Basics and SELECT, FROM, WHERE 1 Assignment 1 is due LECTURE 5, Tuesday, April 10 th, 2018 in StudentTracker by MIDNIGHT MID-TERM EXAM

More information

Module 3 MySQL Database. Database Management System

Module 3 MySQL Database. Database Management System Module 3 MySQL Database Module 3 Contains 2 components Individual Assignment Group Assignment BOTH are due on Mon, Feb 19th Read the WIKI before attempting the lab Extensible Networking Platform 1 1 -

More information

Relational model and basic SQL

Relational model and basic SQL Relational model and basic SQL Introduction to Database Design 2011, Lecture 2 Relational model and keys Basic SQL - Creating tables - Inserting rows - Retrieving information - Joins Overview 2 Relational

More information

DATABASE DESIGN. Fields in database table have a data type. Some of the data types used in database table are explained below.

DATABASE DESIGN. Fields in database table have a data type. Some of the data types used in database table are explained below. DATABASE DESIGN 1. Description A database is a collection of information and is systematically stored in tables in the form of rows and columns. The table in the database has unique name that identifies

More information

University College of Southeast Norway. Web Services. with Examples. Hans-Petter Halvorsen,

University College of Southeast Norway. Web Services. with Examples. Hans-Petter Halvorsen, University College of Southeast Norway Web Services Hans-Petter Halvorsen, 2016.11.01 with Examples http://home.hit.no/~hansha Table of Contents 1. Introduction... 4 1.1. The Problem... 4 1.2. The Solution...

More information

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall The Relational Model Chapter 3 Comp 521 Files and Databases Fall 2014 1 Why the Relational Model? Most widely used model by industry. IBM, Informix, Microsoft, Oracle, Sybase, MySQL, Postgres, Sqlite,

More information