The document provides answers to lab exercises on creating and manipulating tables in a database. It includes answers for creating tables, inserting data, updating records, running queries, and demonstrating relationships between tables. The lab covers topics like creating student, library, employee, insurance, course enrollment, and book dealer databases. Queries are demonstrated to retrieve, update and aggregate data from the tables. Primary keys, foreign keys and relationships between tables are also defined.
mini project in c using data structure SWETALEENA2
This document describes a closet organizer project using data structures in C. The project aims to help users organize their clothes in their closet by allowing them to input details about each item like name, color, material and storage location. It also allows searching for a specific item's details and viewing the full closet contents. Users can add multiple clothing details through linked lists and remove items permanently by name. Sample outputs demonstrate adding details, searching for an item, viewing the full closet details, and deleting a item. The project aims to help users save time finding clothes and avoid buying duplicates.
This presentation summarizes a simple phone book program using linked lists and file handling data structures. Key points include:
- Linked lists and files were used to store and manage contact data in a dynamic way without pre-allocating memory.
- Files allow data to be stored non-volatile, reusable, and portable between systems.
- The program includes functions for loading data from a file into a linked list, validating user input, adding/finding/modifying/deleting records, and writing the linked list data back to the file.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
The document outlines various SQL queries to retrieve and analyze data from database tables. It includes queries to find maximum, minimum, sum and average values, count records that meet certain conditions, calculate differences between values, extract data from specific columns, and join data from multiple tables. It also provides instructions to create tables with different data types, constraints, and relationships between tables. Sample data is inserted and constraints/views are created and dropped.
The document contains 16 sections that describe database management system experiments to be performed. Each section includes instructions to create and manipulate tables, perform queries, and implement concepts like triggers, functions, stored procedures, cursors, and embedded SQL. Students will connect to databases and design systems for payroll, banking, and a library using Visual Basic. Their work will be evaluated based on aim and description, queries, results, output, and records.
This document provides an introduction to SQL and database systems. It begins with example tables to demonstrate SQL concepts. It then covers the objectives of SQL, including allowing users to create database structures, manipulate data, and perform queries. Various SQL concepts are introduced such as data types, comparison operators, logical operators, and arithmetic operators. The document also discusses SQL statements for schema and catalog definitions, data definition, data manipulation, and other operators. Example SQL queries are provided to illustrate concepts around selecting columns, rows, sorting, aggregation, grouping, and more.
The document describes a database schema and associated SQL queries for a library database management system. The schema includes tables for publishers, books, book authors, library programs, book copies, and book lending. SQL commands are provided to create the tables, insert sample data, and write queries to retrieve book details, borrower information, and other relevant data. Views are also created to partition book data and view available book copies. The schema and queries are intended as an exercise for a database management systems laboratory course.
mini project in c using data structure SWETALEENA2
This document describes a closet organizer project using data structures in C. The project aims to help users organize their clothes in their closet by allowing them to input details about each item like name, color, material and storage location. It also allows searching for a specific item's details and viewing the full closet contents. Users can add multiple clothing details through linked lists and remove items permanently by name. Sample outputs demonstrate adding details, searching for an item, viewing the full closet details, and deleting a item. The project aims to help users save time finding clothes and avoid buying duplicates.
This presentation summarizes a simple phone book program using linked lists and file handling data structures. Key points include:
- Linked lists and files were used to store and manage contact data in a dynamic way without pre-allocating memory.
- Files allow data to be stored non-volatile, reusable, and portable between systems.
- The program includes functions for loading data from a file into a linked list, validating user input, adding/finding/modifying/deleting records, and writing the linked list data back to the file.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
The document outlines various SQL queries to retrieve and analyze data from database tables. It includes queries to find maximum, minimum, sum and average values, count records that meet certain conditions, calculate differences between values, extract data from specific columns, and join data from multiple tables. It also provides instructions to create tables with different data types, constraints, and relationships between tables. Sample data is inserted and constraints/views are created and dropped.
The document contains 16 sections that describe database management system experiments to be performed. Each section includes instructions to create and manipulate tables, perform queries, and implement concepts like triggers, functions, stored procedures, cursors, and embedded SQL. Students will connect to databases and design systems for payroll, banking, and a library using Visual Basic. Their work will be evaluated based on aim and description, queries, results, output, and records.
This document provides an introduction to SQL and database systems. It begins with example tables to demonstrate SQL concepts. It then covers the objectives of SQL, including allowing users to create database structures, manipulate data, and perform queries. Various SQL concepts are introduced such as data types, comparison operators, logical operators, and arithmetic operators. The document also discusses SQL statements for schema and catalog definitions, data definition, data manipulation, and other operators. Example SQL queries are provided to illustrate concepts around selecting columns, rows, sorting, aggregation, grouping, and more.
The document describes a database schema and associated SQL queries for a library database management system. The schema includes tables for publishers, books, book authors, library programs, book copies, and book lending. SQL commands are provided to create the tables, insert sample data, and write queries to retrieve book details, borrower information, and other relevant data. Views are also created to partition book data and view available book copies. The schema and queries are intended as an exercise for a database management systems laboratory course.
This document presents a phonebook application created using C programming. It includes sections on the introduction, software and hardware used, design consisting of various modules, and implementation. The key modules are adding, showing, searching, and removing contacts from the phonebook application, which was coded using preprocessor commands, structures, functions, and other C elements.
The document discusses file input and output streams in C++. It covers key topics like:
- Opening files using constructors and the open() function
- Using input and output streams like ifstream and ofstream to read from and write to files
- Controlling file pointers using functions like seekg(), seekp(), tellg(), and tellp()
- Performing sequential and random access file I/O using functions like put(), get(), read(), and write()
- Handling errors during file operations using functions in the ios class like fail(), eof(), bad(), and good()
This document provides information about SQL queries and joins. It begins by introducing SQL (Structured Query Language) which is used to communicate with databases and retrieve required information. It describes the basic CRUD (Create, Read, Update, Delete) functions of SQL. It then discusses different types of SQL queries - aggregate function queries, scalar function queries, and join queries. It provides the syntax and explanation of inner joins, outer joins (left, right, full) which are used to query data from multiple tables based on relationships between columns. The document is presented by Hammad, Bilal and Awais.
This document outlines the syllabus for Computer Science (41) taught by Prof. K. Adisesha. It covers 4 units: Unit A discusses computer hardware components and data structures; Unit B covers object-oriented programming in C++; Unit C focuses on databases, queries, and large data; Unit D examines advanced communication technology concepts like networking and web design. Key topics include motherboards, Boolean algebra, arrays, stacks, queues, classes, inheritance, pointers, files, SQL, networks, and HTML.
This document discusses aggregate functions in SQL. It defines aggregate functions as functions that summarize expression results over multiple rows into a single value. Commonly used aggregate functions include SUM, COUNT, AVG, MIN, and MAX. Examples are provided calculating sums, averages, minimums, and maximums of salaries in an employee table to illustrate the use of these functions. It also discusses issues like ignoring null values and the need to use the GROUP BY clause with aggregate functions.
The document defines and describes various data types in the C programming language. It discusses integer data types like char, short int, int, long int; floating point data types like float, double, long double; void data type; and derived data types like arrays, pointers, structures, unions, enumerated data types, and user-defined data types using typedef. Each data type is explained along with its size, range of values it can hold, and examples.
Pointer is a variable that stores the memory address of another variable. It allows dynamic memory allocation and access of memory locations. There are three ways to pass arguments to functions in C++ - pass by value, pass by reference, and pass by pointer. Pass by value copies the value, pass by reference copies the address, and pass by pointer passes the address of the argument. Pointers can also point to arrays or strings to access elements. Arrays of pointers can store multiple strings. References are alternative names for existing variables and any changes made using the reference affect the original variable. Functions can return pointers or references.
This document provides instructions for creating and modifying tables in a database, performing inserts and updates, and writing SQL queries. It includes steps to prepare employee, department, and salary grade tables, insert data, modify table and column names and structures, add and remove columns, and perform data manipulation and queries on the tables. 42 SQL queries are provided to return specific fields and filter, sort, and format the data in various ways.
SQL is a standard language for accessing and manipulating databases. It allows users to retrieve, insert, update, and delete data as well as create new databases and tables. Common SQL statements include SELECT, UPDATE, DELETE, and INSERT. SQL uses clauses, operators, and wildcards to filter records based on conditions. Some key points are that SQL is an ANSI standard but different versions exist, it allows querying and modifying data in databases, and is essential for interacting with relational database systems.
Contact management system , phone book management systemromie1995
The document describes a student's programming assignment to create a contact management system (CMS) using C++. The CMS allows users to store and manage contact information like names, phone numbers, addresses, and emails. It will use file handling and structures to save contact data in text files. The system will provide options for administrators to add, view, search, and delete contacts from the main menu. The student aims to learn file handling, classes, structures, and restricting user input through this project.
The document discusses arrays and strings in C programming. It defines arrays as groups of data items of the same type that share a common name. One-dimensional arrays are declared with a datatype and size, and can be initialized. Multi-dimensional arrays have multiple subscripts. Strings are arrays of characters that are null-terminated. Strings can be initialized and manipulated using functions like strcpy(), strlen(), strcmp(). Examples are provided to demonstrate array and string declarations, initialization, manipulation and differences between the two data structures.
This document discusses arrays in C++. It begins by introducing arrays and their need, then describes the different types of arrays including single, two, and multi-dimensional arrays. It explains how arrays are stored in contiguous memory locations and indexed starting from zero. The document also covers array initialization, unsized array initialization, and using strings as arrays in C++.
CBSE XII Database Concepts And MySQL PresentationGuru Ji
The document provides an introduction to database concepts and the relational model. It defines what a database is and discusses the purpose of databases, including reducing data redundancy and maintaining data integrity. It also describes different data models like relational, network, and hierarchical models. The relational model is then explained in detail, covering terminology, keys, views, and relational algebra operations like select, project, cartesian product. The document provides examples to illustrate database concepts and the relational model.
The document discusses two-tier and three-tier architectures. The two-tier architecture consists of a client tier and data tier with direct communication between them. It runs faster but has issues handling multiple requests. The three-tier architecture adds a business logic tier between the client and data tiers. This improves scalability, performance, flexibility, re-use, data integrity, and security compared to two-tier. However, it increases complexity.
The document discusses arrays in C programming. It defines arrays as fixed-size collections of elements of the same data type that allow storing and processing large amounts of data. Arrays can be one-dimensional, two-dimensional or multi-dimensional. One-dimensional arrays use a single subscript to identify elements, while two-dimensional arrays use two subscripts to represent rows and columns. The document provides examples of declaring, initializing, and using one-dimensional and two-dimensional arrays in C code.
Inheritance allows new classes called derived classes to be created from existing classes called base classes. Derived classes inherit all features of the base class and can add new features. There are different types of inheritance including single, multilevel, multiple, hierarchical, and hybrid. A derived class can access public and protected members of the base class but not private members. Constructors and destructors of the base class are executed before and after those of the derived class respectively.
The document presents information about functions in the C programming language. It discusses what a C function is, the different types of C functions including library functions and user-defined functions. It provides examples of how to declare, define, call and pass arguments to C functions. Key points covered include how functions allow dividing a large program into smaller subprograms, the ability to call functions multiple times, and how functions improve readability, debugging and reusability of code. An example program demonstrates a simple C function that calculates the square of a number.
This document contains an SQL document with tables, sample data, and SQL queries with answers. It defines tables for locations, departments, jobs, employees, and includes sample data. It then lists 66 SQL queries with varying complexity using keywords like WHERE, GROUP BY, HAVING, ORDER BY, JOIN, SUBQUERY and SET OPERATORS. The queries retrieve and filter data from the tables in different ways, such as finding employees in a department or those earning a certain salary range.
This document contains 42 SQL queries to retrieve and analyze data from various database tables. The queries include finding maximum, minimum, sum and average salaries; counting managers; finding salary differences; joining employee and department tables; adding, modifying and deleting tables; and validating data through constraints.
This document presents a phonebook application created using C programming. It includes sections on the introduction, software and hardware used, design consisting of various modules, and implementation. The key modules are adding, showing, searching, and removing contacts from the phonebook application, which was coded using preprocessor commands, structures, functions, and other C elements.
The document discusses file input and output streams in C++. It covers key topics like:
- Opening files using constructors and the open() function
- Using input and output streams like ifstream and ofstream to read from and write to files
- Controlling file pointers using functions like seekg(), seekp(), tellg(), and tellp()
- Performing sequential and random access file I/O using functions like put(), get(), read(), and write()
- Handling errors during file operations using functions in the ios class like fail(), eof(), bad(), and good()
This document provides information about SQL queries and joins. It begins by introducing SQL (Structured Query Language) which is used to communicate with databases and retrieve required information. It describes the basic CRUD (Create, Read, Update, Delete) functions of SQL. It then discusses different types of SQL queries - aggregate function queries, scalar function queries, and join queries. It provides the syntax and explanation of inner joins, outer joins (left, right, full) which are used to query data from multiple tables based on relationships between columns. The document is presented by Hammad, Bilal and Awais.
This document outlines the syllabus for Computer Science (41) taught by Prof. K. Adisesha. It covers 4 units: Unit A discusses computer hardware components and data structures; Unit B covers object-oriented programming in C++; Unit C focuses on databases, queries, and large data; Unit D examines advanced communication technology concepts like networking and web design. Key topics include motherboards, Boolean algebra, arrays, stacks, queues, classes, inheritance, pointers, files, SQL, networks, and HTML.
This document discusses aggregate functions in SQL. It defines aggregate functions as functions that summarize expression results over multiple rows into a single value. Commonly used aggregate functions include SUM, COUNT, AVG, MIN, and MAX. Examples are provided calculating sums, averages, minimums, and maximums of salaries in an employee table to illustrate the use of these functions. It also discusses issues like ignoring null values and the need to use the GROUP BY clause with aggregate functions.
The document defines and describes various data types in the C programming language. It discusses integer data types like char, short int, int, long int; floating point data types like float, double, long double; void data type; and derived data types like arrays, pointers, structures, unions, enumerated data types, and user-defined data types using typedef. Each data type is explained along with its size, range of values it can hold, and examples.
Pointer is a variable that stores the memory address of another variable. It allows dynamic memory allocation and access of memory locations. There are three ways to pass arguments to functions in C++ - pass by value, pass by reference, and pass by pointer. Pass by value copies the value, pass by reference copies the address, and pass by pointer passes the address of the argument. Pointers can also point to arrays or strings to access elements. Arrays of pointers can store multiple strings. References are alternative names for existing variables and any changes made using the reference affect the original variable. Functions can return pointers or references.
This document provides instructions for creating and modifying tables in a database, performing inserts and updates, and writing SQL queries. It includes steps to prepare employee, department, and salary grade tables, insert data, modify table and column names and structures, add and remove columns, and perform data manipulation and queries on the tables. 42 SQL queries are provided to return specific fields and filter, sort, and format the data in various ways.
SQL is a standard language for accessing and manipulating databases. It allows users to retrieve, insert, update, and delete data as well as create new databases and tables. Common SQL statements include SELECT, UPDATE, DELETE, and INSERT. SQL uses clauses, operators, and wildcards to filter records based on conditions. Some key points are that SQL is an ANSI standard but different versions exist, it allows querying and modifying data in databases, and is essential for interacting with relational database systems.
Contact management system , phone book management systemromie1995
The document describes a student's programming assignment to create a contact management system (CMS) using C++. The CMS allows users to store and manage contact information like names, phone numbers, addresses, and emails. It will use file handling and structures to save contact data in text files. The system will provide options for administrators to add, view, search, and delete contacts from the main menu. The student aims to learn file handling, classes, structures, and restricting user input through this project.
The document discusses arrays and strings in C programming. It defines arrays as groups of data items of the same type that share a common name. One-dimensional arrays are declared with a datatype and size, and can be initialized. Multi-dimensional arrays have multiple subscripts. Strings are arrays of characters that are null-terminated. Strings can be initialized and manipulated using functions like strcpy(), strlen(), strcmp(). Examples are provided to demonstrate array and string declarations, initialization, manipulation and differences between the two data structures.
This document discusses arrays in C++. It begins by introducing arrays and their need, then describes the different types of arrays including single, two, and multi-dimensional arrays. It explains how arrays are stored in contiguous memory locations and indexed starting from zero. The document also covers array initialization, unsized array initialization, and using strings as arrays in C++.
CBSE XII Database Concepts And MySQL PresentationGuru Ji
The document provides an introduction to database concepts and the relational model. It defines what a database is and discusses the purpose of databases, including reducing data redundancy and maintaining data integrity. It also describes different data models like relational, network, and hierarchical models. The relational model is then explained in detail, covering terminology, keys, views, and relational algebra operations like select, project, cartesian product. The document provides examples to illustrate database concepts and the relational model.
The document discusses two-tier and three-tier architectures. The two-tier architecture consists of a client tier and data tier with direct communication between them. It runs faster but has issues handling multiple requests. The three-tier architecture adds a business logic tier between the client and data tiers. This improves scalability, performance, flexibility, re-use, data integrity, and security compared to two-tier. However, it increases complexity.
The document discusses arrays in C programming. It defines arrays as fixed-size collections of elements of the same data type that allow storing and processing large amounts of data. Arrays can be one-dimensional, two-dimensional or multi-dimensional. One-dimensional arrays use a single subscript to identify elements, while two-dimensional arrays use two subscripts to represent rows and columns. The document provides examples of declaring, initializing, and using one-dimensional and two-dimensional arrays in C code.
Inheritance allows new classes called derived classes to be created from existing classes called base classes. Derived classes inherit all features of the base class and can add new features. There are different types of inheritance including single, multilevel, multiple, hierarchical, and hybrid. A derived class can access public and protected members of the base class but not private members. Constructors and destructors of the base class are executed before and after those of the derived class respectively.
The document presents information about functions in the C programming language. It discusses what a C function is, the different types of C functions including library functions and user-defined functions. It provides examples of how to declare, define, call and pass arguments to C functions. Key points covered include how functions allow dividing a large program into smaller subprograms, the ability to call functions multiple times, and how functions improve readability, debugging and reusability of code. An example program demonstrates a simple C function that calculates the square of a number.
This document contains an SQL document with tables, sample data, and SQL queries with answers. It defines tables for locations, departments, jobs, employees, and includes sample data. It then lists 66 SQL queries with varying complexity using keywords like WHERE, GROUP BY, HAVING, ORDER BY, JOIN, SUBQUERY and SET OPERATORS. The queries retrieve and filter data from the tables in different ways, such as finding employees in a department or those earning a certain salary range.
This document contains 42 SQL queries to retrieve and analyze data from various database tables. The queries include finding maximum, minimum, sum and average salaries; counting managers; finding salary differences; joining employee and department tables; adding, modifying and deleting tables; and validating data through constraints.
This document contains a sample paper for Class XII Computer Science subject. It has 7 questions covering various topics in C++ programming. Question 1 has multiple parts on variables, built-in functions, error correction, output of programs, function overloading. Question 2 covers classes, constructors, inheritance. Question 3 includes array and memory problems. Question 4 tests file handling concepts. Questions 5-7 deal with SQL, Boolean algebra, networking, and cyber crimes respectively. The paper tests a range of skills from syntax to problem solving to applying concepts.
Using DDL Statements to Create and Manage Tables
This document discusses using data definition language (DDL) statements to create and manage database tables. It covers categorizing database objects like tables, views, and indexes; defining table structures with columns and data types; creating tables with the CREATE TABLE statement; adding constraints at table creation; and dropping tables with DROP TABLE. The key topics are creating simple tables, understanding available data types, defining columns and constraints, and using DDL statements like CREATE TABLE, ALTER TABLE, and DROP TABLE to manage tables.
Les09 (using ddl statements to create and manage tables)Achmad Solichin
Using DDL Statements to Create and Manage Tables
The document discusses using DDL statements to create and manage database tables. It covers categorizing database objects like tables, views, indexes, and sequences. It also covers the syntax for creating tables, specifying column names and data types, creating constraints, and dropping tables. Examples are provided for creating a simple table, adding constraints, creating a table using a subquery, and altering or dropping existing tables.
This document provides information about functions in Apache Hive, including a cheat sheet covering user defined functions (UDFs) and built-in functions. It describes how to create UDFs, UDAFs, and UDTFs in Hive along with examples. The document also lists many common mathematical, string, date and other function types available in Hive with descriptions.
1. The document contains SQL queries to perform operations on student and course tables like creating tables, inserting data, updating records, joining tables, aggregating data, and more.
2. Basic queries include creating the tables, inserting sample data, adding columns, applying constraints, updating records, deleting records, and selecting records based on conditions.
3. More advanced queries demonstrate using joins, aggregation, sorting, subqueries and other SQL features to retrieve and manipulate the data in various ways.
Here are the SQL commands for the questions:
Q1: SELECT PNAME FROM PROJECT WHERE PLOCATION='Houston';
Q2: SELECT FNAME, LNAME FROM EMPLOYEE WHERE HOURS>20;
Q3: SELECT FNAME, LNAME FROM EMPLOYEE, DEPARTMENT WHERE MGRSSN=SSN;
This document provides information on importing and working with different data types in R. It introduces packages for importing files like SPSS, Stata, SAS, Excel, databases, JSON, XML, and APIs. It also covers functions for reading and writing common file types like CSV, TSV, and RDS. Finally, it discusses parsing data and handling missing values when reading files.
This document contains questions and prompts related to data structures and algorithms topics like arrays, sorting, searching, hash tables, trees, and tree traversals. It asks the reader to analyze, draw, summarize, implement, or describe various concepts through examples, diagrams, pseudocode, or clear written explanations.
Postgres indexes: how to make them work for your applicationBartosz Sypytkowski
Indexes are one of the most crucial structures of any relational database. In this talk we'll explain how to use them efficiently, how to read query plans and what do they mean for us. We'll also cover a variety of different indexing structures available in PostgreSQL database and build up some intuition about which one to pick depending on the situation.
This document contains a data structures question paper from Anna University. It has two parts:
Part A contains 10 short answer questions covering topics like ADT, linked stacks, graph theory, algorithm analysis, binary search trees, and more.
Part B contains 5 long answer questions each worth 16 marks. Topics include algorithms for binary search, linear search, recursion, sorting, trees, graphs, files, and more. Students are required to write algorithms, analyze time complexity, and provide examples for each question.
This document provides a marking scheme for a Computer Science exam for Class XII. It includes instructions, 6 sections (A through C), and multiple choice questions with parts. Section A focuses on C++ programming, Section B on Python, and Section C is compulsory for all students. Questions assess topics like functions, OOPs concepts, arrays, file handling, and more. For each part, the number of marks and what is required are specified. Sample code is provided to test understanding of concepts like data abstraction, inheritance, operator overloading and more.
These are slides from our Big Data Warehouse Meetup in April. We talked about NoSQL databases: What they are, how they’re used and where they fit in existing enterprise data ecosystems.
Mike O’Brian from 10gen, introduced the syntax and usage patterns for a new aggregation system in MongoDB and give some demonstrations of aggregation using the new system. The new MongoDB aggregation framework makes it simple to do tasks such as counting, averaging, and finding minima or maxima while grouping by keys in a collection, complementing MongoDB’s built-in map/reduce capabilities.
For more information, visit our website at http://casertaconcepts.com/ or email us at info@casertaconcepts.com.
1) The document discusses database management systems and describes a student details database with attributes like registration number, name, date of birth, and phone number.
2) It provides SQL commands to perform various operations on the student details table like removing an attribute, changing a data type, adding a new attribute, inserting tuples, and selecting rows based on conditions.
3) The key SQL commands covered are CREATE TABLE, ALTER TABLE, INSERT, and SELECT. Operations like modifying table structure, entering data, and retrieving data based on conditions are demonstrated.
Python 101++: Let's Get Down to Business!Paige Bailey
You've started the Codecademy and Coursera courses; you've thumbed through Zed Shaw's "Learn Python the Hard Way"; and now you're itching to see what Python can help you do. This is the workshop for you!
Here's the breakdown: we're going to be taking you on a whirlwind tour of Python's capabilities. By the end of the workshop, you should be able to easily follow any of the widely available Python courses on the internet, and have a grasp on some of the more complex aspects of the language.
Please don't forget to bring your personal laptop!
Audience: This course is aimed at those who already have some basic programming experience, either in Python or in another high level programming language (such as C/C++, Fortran, Java, Ruby, Perl, or Visual Basic). If you're an absolute beginner -- new to Python, and new to programming in general -- make sure to check out the "Python 101" workshop!
The document provides a model question paper for class 12 computer science. It contains 7 questions covering various topics like C++, OOPs, data structures, file handling, SQL, boolean algebra and networking. The paper has a total of 70 marks distributed across different sub-questions having 1, 2, 3 or 4 marks each. Detailed blueprints specifying the marks distribution across different units is also provided.
This document contains instructions and questions for an exam in Analog and Digital Electronics. It is divided into 5 modules. For each module, there are 2 full questions with multiple parts to choose from. Students must answer 5 full questions, choosing 1 from each module. They must write the same question numbers and answers should be specific to the questions asked. Writing must be legible. The questions cover topics like operational amplifiers, logic gates, multiplexers, flip-flops, counters, and more. Diagrams and explanations are often required.
This document provides information and resources for the Cassandra certification workshop, including:
- Details on the Administrator and Developer certifications and required resources
- A 6-step process for obtaining certification, including completing courses on the DataStax Academy platform and scheduling an exam
- Practice questions covering Cassandra query language (CQL) concepts tested in the certification exams
- A demonstration of the certification process
Similar to DATABASE MANAGEMENT SYSTEM LAB.pdf (20)
Software engineering is concerned with developing software using a systematic process and addressing factors like increasing demands and low expectations. It involves activities like specification, development, validation and evolution. Some key challenges are coping with diversity, reduced delivery times and developing trustworthy software. Different techniques are suitable depending on the type of system, and processes may incorporate elements of models like waterfall, incremental development and integration/configuration. Prototyping can help with requirements, design and testing.
The document provides an introduction to software engineering and discusses software, software engineering, the software development life cycle (SDLC), and SDLC models. It defines software and its components. It describes software engineering goals and challenges. It explains the SDLC phases including feasibility study, requirements analysis, design, development, testing, deployment, and maintenance. It discusses various SDLC models like waterfall, iterative, prototype, spiral, and agile models.
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdfProf. Dr. K. Adisesha
The document discusses requirement engineering and provides details on:
- Types of requirements including functional, non-functional, user, and system requirements
- The requirement engineering process including feasibility studies, elicitation, analysis, specification, validation, and management
- Software requirement specification (SRS) documents, their purpose, characteristics of a good SRS, and typical sections
- Functional and non-functional requirements in more depth
This document discusses system modeling. It defines system modeling as developing abstract models of a system from different perspectives. Common modeling techniques discussed include context models, interaction models, structural models, behavioral models, and model-driven engineering. Specific modeling languages covered are activity diagrams, use case diagrams, sequence diagrams, class diagrams, and state diagrams. The document provides examples and definitions for how to apply these modeling approaches and languages.
Architectural design establishes the framework for software development by examining requirements and designing a model that specifies system components, their inputs/outputs/functions, and interactions. It can be represented using structural, dynamic, process, functional, or framework models. The outputs are an architectural design document and various project plans. Architectural design decisions impact non-functional requirements and common decisions include architectural style and system decomposition.
The document discusses various types of software testing including unit testing, component testing, system testing, test-driven development, release testing, and user testing. It provides details on the goals and processes involved in each type of testing. Unit testing involves testing individual program units in isolation to check functionality. Component and system testing focus on interactions between units and components. Test-driven development interleaves writing tests before code. Release testing validates that software meets requirements before release. User testing involves customers providing input on a system under test.
This document discusses computer communication and networks. It defines data communication and its key characteristics of delivery, accuracy, timeliness and jitter. It describes the core components of a data communication system including the message, sender, receiver, transmission medium and protocols. It then discusses different types of computer networks including LANs, WANs, PANs and MANs. The key aspects covered are their definitions, examples, advantages and disadvantages.
Data communication involves the exchange of data between two devices via transmission media such as cables. It consists of five main components: a message, sender, receiver, transmission medium, and protocol. Data can be transmitted in three modes - simplex, half-duplex, and full-duplex. Transmission media can be guided (wired) such as twisted pair or coaxial cables, or unguided (wireless) such as radio waves. Networks are sets of connected devices that can be arranged in various topologies like bus, star, ring, or mesh. Switching techniques such as circuit, message, and packet switching determine how data is routed through a network.
The document discusses the data link layer. It covers the following key points:
- The data link layer has two sublayers: the logical link control (LLC) sublayer and the medium access control (MAC) sublayer.
- The LLC sublayer controls flow and performs error checking, while the MAC sublayer handles frame encapsulation and network addressing.
- The data link layer is responsible for framing, addressing, error control, flow control, and multi-access functionality. It takes packets and converts them to frames for transmission on the physical layer.
- Error detection techniques used include parity checks and cyclic redundancy checks to validate frames are transmitted accurately. Error correction can be done through retransmission
The document provides an overview of the network layer. It discusses key topics like the functions of the network layer such as logical addressing, routing, and internetworking. It describes different routing algorithms including distance vector, link state, and hierarchical routing. It also covers congestion control mechanisms like leaky bucket algorithm, token bucket algorithm, and admission control that are used to control congestion in the network layer.
The document discusses the transport and application layers of the OSI model. It begins by describing the transport layer, including its responsibilities of process-to-process delivery, end-to-end connections, multiplexing, congestion control, data integrity, error correction, and flow control. It then discusses the transport layer protocols TCP and UDP, comparing their key differences such as connection-oriented vs. connectionless and reliability. The document next covers application layer services and protocols, including DNS, HTTP, FTP, and email. It concludes by describing models like client-server and peer-to-peer that are used in application layer communication.
This document provides an introduction and overview of computer hardware components. It discusses input devices like keyboards, mice, scanners, and digital cameras. It also covers output devices such as monitors, printers, speakers. It describes different types of computers based on size and performance, such as microcomputers, minicomputers, and mainframes. The document then discusses computer memory, including primary memory technologies like RAM and ROM, as well as secondary magnetic storage.
This document provides an overview and introduction to the R programming language. It covers the history and development of R, which originated from the S language at Bell Labs in the 1970s. The document then outlines some key concepts in R including data structures, subsetting, control structures, functions, and debugging. It also discusses the design of the R system including its core functionality in base R and extensive library of additional packages.
The document discusses various government scholarship schemes in India and Karnataka for students. It outlines national schemes administered by ministries like Human Resource Development, Social Justice and Empowerment, Tribal Affairs and Minority Affairs. It also describes state-level schemes in Karnataka for SC/ST/OBC and minority students. Eligibility criteria include family income limits and minimum academic performance. The application process involves applying online through the National Scholarship Portal and State Scholarship Portal.
The document discusses various topics related to process management in operating systems, including:
1) A process is a program in execution that can be in different states like ready, running, waiting, or terminated. The OS uses a process control block to manage information for each process.
2) Processes communicate and synchronize access to shared resources using techniques like message passing and shared memory.
3) CPU scheduling algorithms like first-come first-served, shortest job next, priority, and round robin are used to allocate CPU time between ready processes.
This document provides an introduction to operating systems presented by Prof. K. Adisesha. It discusses key concepts of operating systems including definitions, functions, types, and properties. Specifically, it defines an operating system as an interface between the user and computer hardware. It describes functions such as processor management, memory management, and file management. It outlines different types of operating systems including batch, time-sharing, distributed, and real-time systems. Finally, it discusses properties like batch processing, multitasking, and distributed environments.
An operating system is an interface between a computer user and the computer hardware. The document discusses the key functions of operating systems including memory management, processor management, device management, file management, security, and more. It provides examples of popular operating systems like Linux, Windows, and describes different types of operating systems such as batch, time-sharing, distributed, network, and real-time operating systems.
This document provides an introduction to data structures using C. It discusses types of data structures like arrays, stacks, queues and linked lists. It explains that data structures allow for efficient organization and storage of data in memory based on relationships between elements. The document also covers topics like asymptotic analysis, best/worst/average case time complexities, big-O, omega and theta notations for analyzing algorithms. It provides characteristics of algorithms and data structures and examples of common data structure operations.
The document discusses object-oriented programming concepts in Java including classes, objects, inheritance, polymorphism, and more. It defines classes as templates for creating multiple object instances that share common properties. Objects are initialized through reference variables, methods, or constructors. The document also covers static methods, the this keyword, final keyword, arrays, strings, and other core OOP concepts in Java.
This document discusses Java graphics and input/output. It introduces the Graphics class in Java AWT which is used to draw on components. It describes various Graphics methods like drawString, drawRect. It also discusses AWT event handling and different event classes. Finally, it covers Java I/O streams like InputStream, OutputStream and file streams like FileInputStream and FileOutputStream along with methods to read and write from files.
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
DATABASE MANAGEMENT SYSTEM LAB.pdf
1. Database Management System Lab Manual
Prof. K. Adisesha 1
DATABASE MANAGEMENT SYSTEM LAB
PART – A
1. The STUDENT detail databases has a table with the following attributes. The primarykeys are
underlined. STUDENT (regno: int, name: string, dob: date, marks: int)
a) Create the above table.
b) Remove the existing attributes from the table.
c) Change the date type of regno from integer to string.
d) Add a new attribute phoneno to the existing table.
e) Enter five tuples into the table.
f) Display all the tuples in student table.
g) Delete all the tuples in student table.
h) Delete student table.
Answer
1. Create table studentdb (regno number(10) primary key, name varchar(20), dob date, marks
number(10));
2. Desc studentdb;
3. Alter table studentdb drop column marks;
4. Alter table studentdb modify regno varchar2(20) ;
5. Alter table studentdb add phoneno number(10) ;
6. Desc studentdb;
7. Insert into studentdb values(®no, &name, &dob, &phoneno);
8. Select * from studentdb;
9. Truncate table studentdb;
10. Drop table studentdb;
****************************************
2. A LIBRARY database has a table with the following attributes.
LIBRARY(bookid:int, title:string, author:string, publication:string, yearpub:int, price:real)
a) Create the above table and display attributes.
b) Enter the five tuples into the table
c) Display all the tuples in library table.
d) Display the different publishers from the list.
e) Arrange the tuples in the alphabetical order of the book titles.
f) List the details of all the books whose price ranges between Rs. 100 and Rs. 300
Answer
1. Create table librarydb (bookidnumber(10) primary key, title varchar2(20),author varchar2(20),
publication varchar2(20), year number(5),price number(6,2));
2. Desclibrarydb;
2. Database Management System Lab Manual
Prof. K. Adisesha 2
3. Insert into librarydb values(&bookid, &title, &author, &publication, &year, &price);
4. Select * from librarydb;
5. Select distinct publication from librarydb;
6. Select * from librarydb order by title asc;
7. Select * from librarydb where price between 100 and 300;
*****************************
3. The SALARY database of an organization has a table with the following attributes.
EMPSALARY(empcod:int, empnamee:string, dob:date, department:string, salary:real)
a) Create the above table and display table attributes.
b) Enter the five tuples into the table
c) Display all the employees working in each department
d) Display all the employees working in particular department
e) Display all the number of employees working in department.
f) Find the sum of the salaries of all employees.
g) Find the sum and average of the salaries of employees of a particular department.
h) Find the least and highest salaries that an employee draws.
Answers
1. Create table salarydb(empcode number(10) primary key, empname varchar2(20), dob date,dept
varchar2(15),salary number(10,2));
2. Descsalarydb;
3. Insert into salarydb values(&empcode, &empname,&dob, &dept, &salary) ;
4. Select * from salarydb;
5. Select * from salarydb where dept= “computer”;
6. Select dept, count(*) from salarydb group by dept;
7. Select sum(salary) from salarydb;
8. Select sum(salary), avg(salary) from salarydb where dept= “computer”;
9. Select min(salary) from salarydb;
10. Select max(salary) from salarydb;
*****************************
4. Consider the insurance database given below. The primary keys are underlined and the data types
are specified.
PERSON(driver-id-no: string, name: string, address: string)
CAR(regno: string, model: string, year: int)
ACCIDENT(report-no: int, date: date, location: String)
OWNS(driver-id-no: string, regno: string)
PARTICIPATED(driver-id-no: string, regno: string, report-no: int, damage-amount: int)
a) Create the above tables by properly specifying the primary keys and the foreign keys
b) Enter at least five tuples for each relation.
c) Demonstrate how you
3. Database Management System Lab Manual
Prof. K. Adisesha 3
i) Update the damage amount for the car with specific regno in the accident with report no 12 to
25000.
ii) Add a new accident to the database.
d) Find total number of people who owned cars that were involved in accidents in 2022
e) Find the number of accidents in which cars belonging to a specific model were involved
Answers
1. Create table persondb(driver_id varchar2(20) primary key, name varchar2(20) not null, address
varchar2(30));
2. Create table cardb(regno varchar2(20) primary key, model varchar2(20) not null, year number(5));
3. Create table accidentdb (report_no number(10) primary key, accident_date date, location
varchar2(20));
4. Create table ownsdb (driver_id varchar2(20) references persondb, regno varchar2(20) references
cardb) ;
5. Create table participateddb (driver_id varchar2(20) references persondb, regno varchar2(20);
references cardb, report_no number(10) references accidentdb, damage_amount number(10));
6. Insert into persondb values (&driver_id, &name, &address);
7. Insert into cardb values (®no, &model, &year);
8. Insert into accidentdb values (&report_no, &accident_date, &location);
9. Insert into ownsdb values(&driver_id, ®_no) ;
10. Insert into participateddb values(&driver_id, ®_no, &report_no, &damage_amount);
11. Update participateddb set damage_amount = 25000 where reg_no = 1001 and report_no = 12;
12. Insert into participateddb values (1004,2004,10,3000) ;
13. Select count(*) from accidentdb where accident_date LIKE ‘%-%-22’;
14. Select count(*) from cardb C , participateddb P where C.regno = P.regno and C.model = ‘scoda’;
*****************************
5. Consider the following database of students enrollment in courses and books adopted for each
course.
STUDENT(regno: string, name: string, major: string, bdate: date)
COURSE(course-no: int cname: string, dept: string)
ENROLL(reg-no: string, course-no: int, sem: int, marks: int)
BOOK-ADOPTION(course-no: int, sem: int, book-isbn: int)
TEXT(book-isbn: int, book-title: string, publisher: string, author: string)
a) Create the above tables by properly specifying the primary keys and the foreign keys
b) Enter atleast five tuples for each relation.
c) Demonstrate how you add a new text book to the database and make this book be adopted by some
department.
d) Produce a list of text books (include Course-no, book-isbn, book-title) in the alphabetical order for
courses offered by the ‘Compute Science’ department that use more than two books.
e) List any department that has all its adopted books published by a specific publisher.
Answers
1. Create table student (regno varchar2(10) primary key, name varchar2(20), major varchar2(20), dob
date);
4. Database Management System Lab Manual
Prof. K. Adisesha 4
2. Create table course (courseno number(10) primary key, cname varchar2(20), dept varchar2(20)) ;
3. Create table enrol (regno varchar2(10) references student, courseno number(10) references course,
sem number(5),marks number(5));
4. Create table text(bkisbn number(5) primary key, book_title varchar2(20), publisher varchar2(20),
author varchar2(20)) ;
5. Create table book_adpt (course_no number (10) references course, bkisbn number(5) references
text,sem number(5)) ;
6. Insert into student values (®no, &name, &major, &dob) ;
7. Insert into course values (&courseno, &cname, &dept) ;
8. Insert into enroll values (®no, &courseno, &sem, &marks) ;
9. Insert into text values (&bkisbn, &book_title, &publisher, &author);
10. Insert into book_adpt values (&course_no, &bkisbn, &sem);
11. Insert into text values (2022,’vb’,’skyword’,’SRIKANTH’);
12. Insert into book_adptvalues (104,2022,4);
13. create view compdept as ( selectc.dept, c.courseno, t.book_title, t.bkisbn from course c, book_adpt ba,
text t where c.courseno = ba.course_no and ba.bkisbn = t.bkisbn and dept = ’ COMPUTER ’) order
by t.book_title;
14. select * from compdept;
15. select course_no, bkisbn, book_title from compdept where dept in (select dept from compdept group
by dept having count(*) > =2 ) ;
16. select c.dept, t.book_title, t.publisher from course c,text t, book_adpt b where t.publisher = ‘himalaya’
and c.course_no = b.course_no and b.bkisbn = t.bkisbn;
***********************
6. The following tables are maintained by a book dealer
AUTHOR(author-id: int, name: string, city: string, country: string)
PUBLISHER(publisher-id: int name: string, city: string, country: string)
CATLOG(book-id: int, title : string, author-id: int, publisher-id: int, category: int, year: int,
price: int)
CATEGORY(category-id: int, description: string)
ORDER-DETAILS(order-no: int, book-id: int, quantity: int)
a) Create above tables by properly specifying the primary keys and the foreign keys.
b) Enter at-least five tuples for each relation.
c) Give the details of the authors who have 2 or more books in the catalog and the price of the books is
greater than the average price of the books in the catalog and the year of publication is after 2021.
d) Find the author of the book which has maximum sales.
e) Demonstrate how to increase price of books published by specific publisher by 10%
Answers
1. create table authordb (author_idnumber(5) primary key , name varchar2(15) not null, city
varchar2(10),country varchar2(10)) ;
2. create table publisherdb (publisher_id number(5) primary key, name varchar2(15) not null, city
varchar2(15),country varchar2(15));
5. Database Management System Lab Manual
Prof. K. Adisesha 5
3. create table catalogdb (book_id number(5) primary key, title varchar2(15) not null, author_id
number(5) references authordb, publisher_id number(5) references publisherdb, year number(5), price
number(8)) ;
4. create table categorydb (category_id number(5) primary key, description varchar2(15)) ;
5. create table orderdb (order_id number(5) primary key, book_id number(5) references
catalogdb,quantity number(5)) ;
6. insert into authordb values (&author_id, &name, &city, &country) ;
7. insert into publisherdb values (&publisher_id, &name, &city, &country) ;
8. insert into catalogdb values (&book_id, &title, &author_id, &publisher_id, &year, &price) ;
9. insert into categorydb values (&category_id, &description);
10. insert into orderdb values (&order_id, &book_id, &quantity) ;
11. select c.author_id, a.name from catalogdb c, authordb a where a.author_id = c.author_id and c.price
> (select avg (price) from catalogdb group by c.author_id , a.name having count(*) > 2) ;
12. update catalogdb set price = price*1.10 where publisher _id = 10;
***************************************
7. Consider the following database for BANK.
BRANCH(branch-name: string, branch-city: string, assets: real)
ACCOUNT(accno: int, branch-name: string, balance: real)
DEPOSITOR(customer-name: string, accno: int)
CUSTOMER(customer-name: string, customer-street: string, customer-city: string)
LOAN(loan-no: int, branch-name: string, amount: real)
BORROWER(customer-name: string, loan-no: int)
a) Create the above tables by properly specifying the primary keys and foreign keys.
b) Enter at-least five tuples for each relation.
c) Find all the customers who have at-least two accounts at the main branch.
d) Find all customer who have an account at all the branches located in a specific city.
e) Demonstrate how to delete all account tuples at every branch located in specific city.
Answers
1. Create table branchdb (bname varchar2(15) primary key, bcity varchar2(15) not null, asset
number(8,4));
2. Create table accountdb (accno number(10) primary key , bname varchar2(15) references branchdb,
balance number(10,2)) ;
3. create table depositordb(cname varchar2(15) not null, accno number(5) references accountdb primary
key(cname, accno));
4. create table customerdb (cname varchar2(15) primary key, cstreet varchar2(15), ccity varchar(15));
5. create table loandb (loanno number(10) primary key, bname varchar2(15) references branchdb
,amount number(10,2));
6. create table borrowerdb (cname varchar2(20) not null, loanno number(10) references loandb, primary
key(cname, loanno) ;
6. Database Management System Lab Manual
Prof. K. Adisesha 6
7. insert into branchdb values (&bname, &bcity, &asset) ;
8. insert into accountdb values (&accno, &bname, &balance) ;
9. insert into depositordb values (&cname, &accno);
10. insert into customerdb values (&cname, &cstreet, &ccity);
11. insert into loandb values (&loanno, &bname, &amount);
12. insert into borrowerdb values (&cname, &loanno);
13. create view decacc as (selelctb.bname,a.accno,d.cname from branchdb b,accountdb a,depositordb d
where a.accno = d.accno and a.bname = b.bname and b.bname = ‘KR Puram’);
14. select bname, accno, cname from decacc where cname in (select cname from decacc group by cname
having count (*)>=2);
15. select d.cname,a.accno,b.bname,b.bcity from depositordb d, accountdb a, branchdb b where b.bcity =
‘bangalore’ and d.accno = a.ccno and a.bname=b.bname;
16. delete from accountdb where bname in (select bname from branchdb where bcity= ‘Bangalore’);
******************************************
8. Consider the following database for ORDER PROCESSING.
CUSTOMER(cust-no: int, cname: string, city: string)
ORDER(orderno: int, odate: date, ord-amt: real)
ORDER_ITEM(orderno: int, itemno:int, qty: int)
ITEM(itemno: int, unitprice: real)
SHIPMENT(orderno: int, warehouseno: int, ship-date: date)
WAREHOUSE(warehouseno: int, city: string)
a) Create the above tables by properly specifying the primary keys and the foreign keys
b) Enter at least five tuples for each relation.
c) List the order number and ship date for all orders shipped from particular warehouse
d) Produce a listing: customer name, no of orders, average order amount
e) List the orders that were not shipped within 30 days of ordering
Answers
1. create table customerdb (cust_idnumber(6) primary key,cname varchar2(20) not null, ccity
varchar2(20));
2. create table custorderdb (orderno number(6) primary key,orderdate date, customer_no number(6),
order_amt number(6)) ;
3. create table itemdb (item_no number(6) primary key , unitprice number(6)) ;
4. create table warehoused (warehouseno number(5) primary key,city varchar2(12)) ;
5. create table shipmentdb (orderno number(6) references custorderdb, warehouse_no number(5)
references warehouse_db, shipdate date);
6. insert into customerdb values(&cust_id, &cname, &ccity) ;
7. insert into custorderdb values(&orderno, &orderdate, &customer_no, &order_amt) ;
8. insert into itemdb values(&item_no, &unitprice) ;
9. insert into warehousedb values(&warehouseno, &city) ;
7. Database Management System Lab Manual
Prof. K. Adisesha 7
10. insert into shipmentdb values (&orderno, &warehouse_no, &shipdate);
11. select orderno, shipdate from shipmentdb where warehouse_no=1002;
12. select c.cname, count(co.orderno), avg(co.order_amt) from customerdbc, customer_db co where
c.cust_id = co.customer_no group by c.cname,co. customer_no;
13. select c.cname ,co.orderno,co.orderdate,sh.shipdate from customerdbc, custorderco, shipmentdbsh
where c.cust_id =co.customer_no and co.orderno = sh.orderno and (to_date (sh.shipdate) - o_date
(co.orderdate))>30 ;
*********************************************
PART – B
1. Write a PL/SQL program to find the largest of three numbers
declare
a number;
b number;
c number;
begin
a:=&a;
b:=&b;
c:=&c;
if (a>b and a>c) then
dbms_output.put_line('a is largest'||a);
elsif (b>a and b>c) then
dbms_output.put_line('b is largest'||b);
else
dbms_output.put_line('c is the largest'||c);
end if;
end;
/
2. Write a PL/SQL program to generate reverse for given number
declare
n number(4) := &n;
s number(4) := 0;
r number(4);
begin
while n > 0
loop
r:= mod(n,10);
s:=(s*10)+r;
n:=trunc(n/10);
8. Database Management System Lab Manual
Prof. K. Adisesha 8
end loop;
dbms_output.put_line('the reverse number is');
dbms_output.put_line(s);
end;
/
3. Write a PL/SQL program to find the factorial of a given number
declare
inumber(4) :=1;
n number(4) := &n;
f number(4) :=1;
begin
for i in 1..n
loop
f:=f*i;
end loop;
dbms_output.put_line('factorial of a number is'|| f);
end;
/
4. Write a PL/SQL program to check whether given number is prime or not
declare
num number;
inumber := 1;
c number := 0;
begin
num := #
for i in 1..num
loop
if ((mod(num,i))=0)
then
c:=c+1;
end if;
end loop;
if (c>2)
then
dbms_output.put_line(num|| 'not prime');
else
dbms_output.put_line(num || 'is prime');
end if;
end;
/
5. Write a PL/SQL program to generate Fibonacci series upto N
declare
a number(3) := 1;
b number(3) := 1;
9. Database Management System Lab Manual
Prof. K. Adisesha 9
c number(3);
n number(3);
begin
n:=&n;
dbms_output.put_line('the Fibonacci series is:');
while a<=n loop
dbms_output.put_line(a);
c:=a+b;
a:=b;
b:=c;
end loop;
end;
/
6. Write a PL/SQL program for inserting a row into employee table
create table employee (emp_idnumber(5) primary key,emp_name varchar2(30),Emp_dept
varchar2(10),emp_salary varchar2(8));
Declare
begin
insert into employee values(10,'Adisesha','hod',40000);
End;
/
7. Write a pl/sql program to handle a predefined exception
declare
n number(4);
d number(4);
begin
n:=&n;
d:=n/0;
exception
when zero_divide then
dbms_output.put_line('divide by error exception is caught');
end;
/
8. Write a pl/sql program for creating a procedure for calculating sum of two numbers.
Create or replace procedure sum(n1 in number,n2 in number) is
Total number(6);
Begin
Total:= n1+n2;
Dbms_output.put_line('the sum is'||total);
End;
/
Execution:
SQL>exec sum(10,20);
The sum is : 30
10. Database Management System Lab Manual
Prof. K. Adisesha 10
9. Write a procedure to check the given year is leap year or not
Create or replace procedure leapyear(y in number) is
Begin
If y mod 4 = 0 and y mod 100 <> 0 or y mod 400 =0 then
Dbms_output.put_line ('the given year is leap year');
Else
Dbms_output.put_line('the given year is not leap year');
End if;
End;
/
Calling a above procedure
Leapyear(2022);