answersLogoWhite

0

📱

Database Programming

Databases are collections of tables that maintain and display information, often collaboratively; this information can be used for interaction with an application or gaining general knowledge. Questions about database engines and modifying or using them belong in this category.

8,803 Questions

What is computerized inventory system?

Most likely a database. Something created with Microsoft Access. Inventory control system? Computerized inventory system? What is accountory n inventory? What the inventory system does? What is computerized inventory? Computerrized inventory system? What is an inventory system called? How do you set up an inventory system? Example of perpetual inventory system? Advantages of periodic inventory system? What is bad order in an inventory system? Need of computerized inventory accountoing? What benefits will you get having a inventory system? What is the Benefit of computerized inventory system? What are the theoretical framework of inventory system? Consider developing a system for inventory for super marketthat has anumber of branches all over city?

Is sql language is case sensitive?

Answer

No, SQL is not defined as case-sensitive in the standards.


However, certain implementations of SQL may be case sensitive, in certain scenarios. Notably, MySQL on a Linux or Unix server is most likely case sensitive in regards to table names. Also, some collations (string storage formats) are case sensitive. Finally, column and table names may be case sensitive within a query on some SQL servers (i.e. "select * from USER where user.name = 'test'" might result in an error). When it doubt, check the manuals for the server you are using.

Describe the 3 levels of government?

depending on what country you live in, here in Canada we have municipal, provincial and then federal.

What is meant by flow of execution a program?

That means to load a computer program into a computer's memory, and have the computer carry out the instructions in the program.

Explain the basic datatypes in C?

C datatype can be categories into two part

1) Scalar data type 2) derived data type..

The scalar data type is also called basic data type

they are

int

char

float

double

long

signed or unsigned are key word which effectively change the storing power of these data type.

by default they are signed in nature..

What is digital data?

Digital data is discrete data that is used in computers to handle all sorts of digital media, including text, graphics and audio. It only exists in two forms - on and off. This is represented with two digits- 1s and 0s - in the binary format. Since digital data is discrete, files saved in this format can be copied perfectly with no degradation.

What is the function of data-compression utility?

The function of a data compression utility is to reduce the file size and thus maximise storage capacity. The compression has to be done in such a way that the original data can be restored by a corresponding decompression utility.

The simplest way to compress data is to use a variable-length encoding rather than a fixed-length encoding. Normally, data is stored using a sequence of symbols with fixed-width codes (typically 8-bit bytes). However, some symbols appear more frequently than others, so by using fewer bits to represent the most frequent symbols and more bits for the less frequent ones, data can be stored much more efficiently.

To achieve this, no two symbols can have the same prefix. This is, if the space character (which is the most common symbol in text data) is represented by the 1-bit code 0, then no other symbol can be prefixed with a 0 -- they must all be prefixed with a 1. The letter 'e' is also quite common, thus we might give it the 2-bit prefix 10, which means all other symbols must have a 11 prefix. The problem with this encoding scheme is that with each new symbol we have to add another bit. If our data contains 127 unique symbols (the entire ANSI character set), then the least-frequent symbol would consume 127 bits! Although we may still be able to reduce the overall size of the data, this is not the most efficient method of doing so. We could achieve very similar savings just by using a 7-bit byte instead (which is sufficient to encode the entire ANSI character set).

Prior to 1951 there was no algorithm capable of producing the most efficient prefix encoding. We knew that binary trees offered the solution, where leaf nodes represented the symbols we wished to encode and the path from the root node of the tree determined the prefix (appending a 0 bit when we branched left and a 1 when we branched right). Thus every symbol had a unique path and therefore a unique prefix. However, building such a tree was a complex process and there was no guarantee the end result would produce the most efficient encoding without a good deal of trial and error.

David A. Huffman came up with the solution in 1951. Instead of building the tree from the root, he built the tree from the bottom up. First, he created a frequency table of all the unique symbols in the data, sorted in descending order of frequency. He then extracted the bottom entry (the least frequent symbol) and attached it to the left node of a parent node. He then took the next least frequent symbol and attached it to the right. The parent's frequency became the sum of its two nodes and it was re-inserted into the table in sorted order. In other words, he removed two entries and inserted one, thus reducing the table by one entry overall. He then repeated this process continually until there was only one entry left. That one entry became the root of the binary tree. As simple as it sounds, this algorithm produces the most efficient prefix encoding, all we have to do is branch left (append a 0) or branch right (append a 1) and when we reach a symbol (which is always a leaf) we have the prefix for that symbol. We can then rescan the original data and output a contiguous sequence of prefixes to create the payload.

In order to decompress Huffman coded data, we must also be able to recreate the original tree that was used to compress it. Since there are only two types of node (parent or leaf) and every parent has two nodes and every leaf holds a symbol, we simply need to traverse the tree in depth-first order from the root. This is a recursive operation where we examine the left node followed by the right node. If we examine the left node and find it is a leaf, we output a 1 bit followed by its 8-bit symbol. But if the left node is a parent, we output a 0, traverse to it, and repeat the process with that node. Eventually we get back to the root where we can examine its right node. Again, if it is a leaf we output a 1 followed by its symbol, otherwise we output a 0 and traverse to it. Eventually we arrive back at the root and the entire tree has been encoded.

The only other piece of information we need is the number of symbols in the payload (equal to the size of the original data in bytes). Once we have all three we can build the compressed data, outputting the size, followed by the encoded tree, followed by the payload. If the final size is not a multiple of 8 bits, we simply pad the remaining bits with zeroes.

To decompress, we read back the size and store it. We then create a parent node for the root of the tree and begin reading the encoded tree one bit at a time. If the bit is a 1, we create a leaf node on the left and read the next 8 bits to determine its symbol, otherwise we create a parent on the left, traverse to it. Eventually we arrive back at the root and can process its right node in the same way. Once that's done we'll have rebuilt the tree.

Then we can process the payload, starting at the root. If we read a 0, we traverse left, otherwise we traverse right. If the node we traverse to is a leaf, we output the symbol, otherwise we read the next bit and traverse left or right until we do reach a symbol. Once we output a symbol, we increment a counter and start again from the root. When the counter is equal to the size we read at the start, we can stop processing; any remaining bits are just padding.

The algorithm is elegant and, even with the added weight of the encoded tree, can produce significant savings in space for any moderate sized file. For example, the Project Gutenberg Etext version of Moby Dick comes in at 1,256,165 bytes, but is only 720,043 bytes when compressed with Huffman encoding (57% of the original). Huffman coding can be found in more complex algorithms which can compress data even further. For instance, RAR (Roshal Archive, by Eugene Roshal) can compress the same file down to just 443,371 bytes (35%)!

What is crash recovery in dbms?

STACK ADT

OBJECTS: a finite ordered list with zero or more elements.

METHODS: for all stack Î Stack, item Î element, max_stack_size Î positive integer

Stack create S(max_stack_size) ::=create an empty stack whose maximum size is max_stack_size

Boolean isFull(stack, max_stack_size)::=

if (number of elements in stack CreateQ(max_queue_size))

return TRUE

else

return FALSE

Element dequeue(queue) ::=

if (IsEmptyQ(queue))

return

else

remove and return the item at front of queue.

How do you write a c program for performing file operations on student database?

#include<stdio.h>

#include<string.h>

#include<conio.h>

/*Structure created for student record*/

typedef struct student

{

int roll_no;

char name[30];

}student;

void copy(char [],char []);

/*Function to create or insert the records

In write mode it creates new file and write the records

In append mode it insert the records in already created file

*/

void create(char mode[])

{

student stud;

FILE *fp;

int total,i;

fp=fopen("Records.txt",mode);

if(fp==NULL)

printf("\nUnable to open the file");

else

{

printf("\nHow many record(s) do you want to enter\t");

scanf("%d",&total);

for(i=0;i<total;i++)

{

printf("Enter the roll no and name\t");

scanf("%d %s",&stud.roll_no,stud.name);

fprintf(fp,"\n\t%d \t%s",stud.roll_no,stud.name);

}

printf("\nRecord(s) inserted successfully...");

fclose(fp);

}

}

/*This function displays the record of file passed to it

using fread and fwrite*/

void display(char filename[])

{

student stud;

FILE *fp;

fp=fopen(filename,"r+");

if(fp==NULL)

printf("\nUnable to to open file");

else

{

while(fscanf(fp,"\n\t%d \t%s",&stud.roll_no,stud.name)!=EOF)

{

printf("\n%d\t%s",stud.roll_no,stud.name);

}

}

fclose(fp);

}

/*Function to search the records

It returns -1 if search is unsuccessful

else return 0*/

int search(int roll)

{

student stud;

FILE *fp;

fp=fopen("Records.txt","r+");

if(fp==NULL)

printf("\nUnable to to open file");

else

{

while(fscanf(fp,"\n\t%d \t%s",&stud.roll_no,stud.name)!=EOF)

{

if(roll 0)

printf("\n\tREnamed...\n\n");

//fclose(fp1);

printf("\n\nRecords deleted successfully...");

}

else

printf("\nOops! Record not found...");

}

}

/*Function to copy all records from one file to other*/

void copy(char f1[],char f2[])

{

student stud;

FILE *fp1,*fp2;

fp1=fopen(f1,"r+");

fp2=fopen(f2,"w+");

if(fp1==NULL fp2==NULL)

printf("\nUnable to to open file");

else

{

while(fscanf(fp1,"\n\t%d \t%s",&stud.roll_no,stud.name)!=EOF)

{

fprintf(fp2,"\n\t%d \t%s",stud.roll_no,stud.name);

}

fclose(fp1);

fclose(fp2);

printf("\n\nRecords copied successfully...");

printf("\nContents are...\n");

display(f2);

}

}

FILE *fp;

/*Main function starts*/

void main()

{

int ch,i,roll;

//if(!(fp=fopen("record.txt","r+")))

//fp=fopen("Record.txt","w+");

do

{

clrscr();

/*Menu for the function*/

printf("\n*** MENU ***");

printf("\n1.Create");

printf("\n2.Insert");

printf("\n3.Update");

printf("\n4.Search");

printf("\n5.Display");

printf("\n6.Copy");

printf("\n7.Delete");

printf("\n8.Exit");

printf("\nEnter your choice\t");

scanf("%d",&ch);

switch(ch)

{

case 1:create("w+");break;

case 2:create("a+");break;

case 3:modify();break;

case 4:

printf("\nEnter the roll no to be searched\t");

scanf("%d",&roll);

i=search(roll);

if(i==-1)

printf("\nOops! Record not found");

break;

case 5:display("Records.txt");break;

case 6:copy("Records.txt","Newcopy.txt");break;

case 7:Delete();break;

case 8:break;

default:printf("\nPlease enter proper choice...");

}

getch();

}while(ch!=8); /*Program terminates on choice 8*/

}

Written by: Fabianski Benjamin

Why do you need assembly language?

Assembly language is more human-readable than machine language. Generally, statements in assembly language are written using short codes for the instruction and arguments, such as "MOV $12 SP", as opposed to machine language, where everything is written as numbers. Assembly language can have comments and macros as well, to ease programming and understanding.

Generally, programs called "assemblers" transform assembly language to machine language. This is a relatively straightforward process, there being a clear 1-to-1 transformation between assembly and machine language. This is as opposed to compilers, which do a complicated transformation between high-level language and assembly.

--------------------------------------------------------------------

ASSEMBLY is the key word to define the difference between Machine Language and Assembly. . Assembly language assembles steps of MACHINE CODE into SUB-ROUTINES defined by simple text words:

Such as: the assembly command 'ADD' may represents 20-30 machine commands.

What is the difference between database and relational database?

A database is something that stores data. Using tools called Database Management Systems(like Oracle, Informix, Sybase, DB2), you can create, view, modify, and delete databases. Databases can be -Relational -Object Oriented -Object Relational Relational database stores data in tables(called realtions). These tables are related to each other.Just like in our family, our relations are related with each other. In Object Oriented Databases, the information is stored in the form of Objects as in Object Oriented Programming.OODBMS makes database objects appear as programming language objects in one or more porgramming languages. Object relational databases combine the features of both Object Oriented as well as Relational databases. Here you can not only store simple data like text in relational, but you can also store complex objects like images, audio and video in tables.

Explain how a private data of a base class can be accessed by publicly derived class?

The only way that private attributes of a base class can be accessed by a derived class (protected or public) is through a protected or public method in the base class.

The protected or public method is the interface through which access to the attributes is defined and controlled.

What is round-robin scheduling?

The term round-robin often refers to something being done to many elements belonging to a group, one element at a time. It is the idea of the task being carried out "one element at a time" that is central here.

Latest inventions in the field of computerized database?

Google

Search Engines

iTunes

databases that are stored on the computer

What is the purpose of an array?

An array is a sequence of logically related data items. It is a kind of row mad of boxes with each box holding a value . Each box can be accessed by , first box , second box, third box, so on. till the nth

box.

( submit by keshaw kumar Bokaro Niit)

How you can create a rounded border on HTML Table?

You can use the code from below example:

<TABLE BORDER=5 BORDERCOLOR=BLUE>

<TR>

<TD>Row1Column1</TD>

<TD>Row1Column2</TD>

</TR>

<TR>

<TD>Row2Column1</TD>

<TD>Row2Column2</TD>

</TR>

</TABLE>

Explain what the term 'data' means?

Data, in the Scientific Method, means a record of the progress of your experiment. Data is whatever you observe about your experiment that may or may not change during the time of the experiment.

How xml works in simple language?

XML is abbreviated for Extensible Markup Language and is used to define data which can be readble by machine and human both. It is a software and hardware independent tool.

What are the types of data in science?

A data is classified as scientific if the cultivation came from a scientific process and research. This means the conclusion in every experiment is a scientific data or those that are taken to account before the experiment occurs.

What are the advantages and disadvantages of working with multiple DBMS tables?

The advantages of DBMS are as follows:

-Controlling redundancy

-Providing storage structure for efficient query processing.

-Restricting unauthorized users.

-Providing concurrency.

-Providing backup and recovery.

-Enforcing integrity constraints.

The disadvantages are as follows:

-Centralization:That is use of the same program at a time by many user sometimes lead to loss of some data.

-High cost of software.

technical experties are required

power dependency

--

Reporting features like charts of a spreadsheet like Excel may not be available in RDBMS.

Code of Round-robin scheduling in c?

#include<stdio.h>

#include<conio.h>

main()

{

int st[10],bt[10],wt[10],tat[10],n,tq;

int i,count=0,swt=0,stat=0,temp,sq=0;

float awt=0.0,atat=0.0;

clrscr();

printf("Enter number of processes:");

scanf("%d",&n);

printf("Enter burst time for sequences:");

for(i=0;i<n;i++)

{

scanf("%d",&bt[i]);

st[i]=bt[i];

}

printf("Enter time quantum:");

scanf("%d",&tq);

while(1)

{

for(i=0,count=0;i<n;i++)

{

temp=tq;

if(st[i]==0)

{

count++;

continue;

}

if(st[i]>tq)

st[i]=st[i]-tq;

else

if(st[i]>=0)

{

temp=st[i];

st[i]=0;

}

sq=sq+temp;

tat[i]=sq;

}

if(n==count)

break;

}

for(i=0;i<n;i++)

{

wt[i]=tat[i]-bt[i];

swt=swt+wt[i];

stat=stat+tat[i];

}

awt=(float)swt/n;

atat=(float)stat/n;

printf("Process_no Burst time Wait time Turn around time

");

for(i=0;i<n;i++)

printf("%d %d %d %d

",i+1,bt[i],wt[i],tat[i]);

printf("Avg wait time is %f

Avg turn around time is %f",awt,atat);

getch();

}