Conditional Retrieval WHERE clause

  SQL> select * 2 from employee; FNAME MINIT LNAME ——————– ——————– ————— SSN BDATE ADDRESS SEX ——————– ——— ——————– —– SALARY SUPER_SSN DNO ———- ——————– ———- Varun ganesh deva 0236 30-OCT-98 sediyapu puttur M 15000 1230 1 prjwal k raj 4126 13-DEC-93 jp nagara banglore M 14500 1240 2 FNAME MINIT LNAME ——————– ——————– … Read moreConditional Retrieval WHERE clause

Illustrate the use of SELECT statement

1) Retrieve the book details of all the books by Ramesh.   SQL> select * 2 from book_authors 3 where author_name='Ramesh'; BOOK_ID AUTHOR_NAME ———- ————— BOOKID03 Ramesh 2)Retrieve employee name,ssn ,bdate,dno with all employee details. SQL> select fname,lname,ssn,bdate,dno 2 from employee; FNAME LNAME SSN BDATE ——————– ——————– ——————– ——— DNO ———- Varun deva 0236 30-OCT-98 … Read moreIllustrate the use of SELECT statement

Create the following tables for COMPANY database.

EMPLOYEE Fname Minit Lname Ssn Bdate Address Sex Salary Super_ssn Dno   DEPARTMENT Dname Dnumber Mgr_ssn Mgr_start_date   DEPT_LOCATIONS Dnumber Dlocation   PROJECT Pname Pnumber Plocation Dnum   WORKS_ON Essn Pno Hours   DEPENDENT Essn Dependent_name Sex Bdate Relationship   DEPARTMENT: SQL> create table DEPARTMENT 2 ( 3 Dname varchar2(20) not null unique, 4 Dno … Read moreCreate the following tables for COMPANY database.

Consider a GRADE_BOOK database in which instructions within an academic department record point earned by individual students in theory classed. The data requirements are summarized as follows

  Each student is identified by a unique identifier, first and last name and an E-mail address.  Each instructor teaches certain courses each term. Each course is identified by a course number, a section number and the term it is taught. For each course he/she teaches, instructor specifies a minimum number of points required in … Read moreConsider a GRADE_BOOK database in which instructions within an academic department record point earned by individual students in theory classed. The data requirements are summarized as follows

Using any open source data modeling tool, design and develop a ER diagram for the following Library database. Specify relevant reverential constrains,

  BOOK_AUTHORS  BOOK_ID  AUTHOR_NAME   PUBLISHER  NAME  ADDRESS PHONE BOOK_COPIES BOOK_ID BRACH_ID NO_COPIES   BOOK_LOANS BOOK_ID BRANCH_ID CARD_NO DATE_HIRED DUE_DATE   LIBRARY_BRANCH BRANCH_ID BRANCH_NAME ADDRESS   BORROWER CARD_NO  NAME  ADDRESS PHONE   BOOK_AUTHORS: SQL> create table BOOK_AUTHORS 2 ( 3 BOOK_ID varchar2(10) not null primary key, 4 AUTHOR_NAME varchar2(15) 5 ); Table created. SQL> desc … Read moreUsing any open source data modeling tool, design and develop a ER diagram for the following Library database. Specify relevant reverential constrains,

Write a program to search a given number using binary search.

PROGRAM;   #include<stdio.h> main() { int A[20],n,i,j,temp; clrscr(); printf(“Enter the size of array:\n”); scanf(“%d”,&n); printf(“Enter the array elements:\n”); for(i=0;i<n;i++) scanf(“%d”,&A[i]); for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(A[j]>A[j+1]) { temp=A[j]; A[j]=A[j+1]; A[j+1]=temp; } } } printf(“The sorted arrays are as follows:\n”); for(i=0;i<n;i++) printf(“%d\t”,A[i]); printf(“enter the key element to search”) scanf(“%d”,&key); min=0; max=n-1; while(min<=max) { mid=(int)((min+max)/2); if(key==A[mid]) { printf(“key … Read moreWrite a program to search a given number using binary search.

Write a c program to search a given number using linear search.

PROGRAM;   #include<stdio.h> main() { int nums[40]; int key,i,n,location=0; clrscr(); printf(“Enter the size of an array:\n”); scanf(“%d”,&n); printf(“Enter the array element:\n”); for(i=0;i<n;i++) scanf(“%d”,&nums[i]); printf(“Enter the key element:”); scanf(“%d”,&key); for(i=0;i<n;i++) if(nums[i]==key) { location=i+1; break; } if(location==0) { printf(“The given key element doesn’t exist and is not found”); } else printf(“The given key element %d exists and … Read moreWrite a c program to search a given number using linear search.

Write a C program to sort an array using selection sort

PROGRAM:   #include<stdio.h> main() { int i,j,a[10],n,small,index,temp; clrscr(); printf(“\nEnter the number of array\n”); scanf(“%d”,&n); printf(“\nEnter the array elemnts\n”); for(i=0;i<n;i++) scanf(“%d”,&a[i]); for(i=0;i<n;i++) { small=a[i]; index=i; for(j=i+1;j<n;j++) { if(a[j]<small) { small=a[j]; index=j; } } temp=a[index]; a[index]=a[i]; a[i]=temp; } printf(“sorted list is\n”); for(i=0;i<n;i++) printf(“%d\t”,a[i]); getch(); }   OUTPUT: Enter the size of array 5 Enter the array elemnts … Read moreWrite a C program to sort an array using selection sort

Write a c program to sort an array using bubble sort.

PROGRAM;   #include&lt;stdio.h&gt; main() { int A[20],n,i,j,temp; clrscr(); printf(&quot;Enter the size of array:\n&quot;); scanf(&quot;%d&quot;,&amp;n); printf(&quot;Enter the array elements:\n&quot;); for(i=0;i&lt;n;i++) scanf(&quot;%d&quot;,&amp;A[i]); for(i=0;i&lt;n;i++) { for(j=0;j&lt;n;j++) { if(A[j]&gt;A[j+1]) { temp=A[j]; A[j]=A[j+1]; A[j+1]=temp; } } } printf(&quot;The sorted arrays are as follows:\n&quot;); for(i=0;i&lt;n;i++) printf(&quot;%d\t&quot;,A[i]); getch(); }   OUTPUT:   Enter the size of array: 6 Enter the array elements: … Read moreWrite a c program to sort an array using bubble sort.

Write a c program to implement binary tree traversal operations.

program; #include&lt;stdio.h&gt; #include&lt;conio.h&gt; struct node { struct node *left; int data; struct node *right; }; void main() { int num,choice,x; struct node *tree,*ntree; void create(struct node*,int); void inorder(struct node*); void preorder(struct node*); void postorder(struct node*); clrscr(); printf(&quot;Create a Binary tree\n\n&quot;); tree=(struct node*) malloc(sizeof(struct node)); printf(&quot;Input number \n\n&quot;); printf(&quot;Press ctrl+z to EOF\n&quot;); scanf(&quot;%d&quot;,&amp;num); tree-&gt;data=num; tree-&gt;left=NULL; tree-&gt;right=NULL; … Read moreWrite a c program to implement binary tree traversal operations.