Slip 6 - C) Consider the following entities and their relationships. Create a RDB in 3 NF with appropriate data types and Constraints. Project (pno, pname, start_date, budget, status) Department (dno, dname, HOD, loc) The relationship between Project and Department is Many to One. Constraint: Primary key. Project Status Constraints: C – Completed, P - Progressive, I - Incomplete Consider the above tables and execute the following queries: 1. Drop loc column from department table. 2. Display the details of project whose start_date is before one month and status is “Progressive”

Solution:


#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
    float distance, a, b, c, d;
    printf("\nEnter The Coordinates of Point A:\n");
    printf("\nX - Axis Coordinate: \t");
    scanf("%f", &a);
    printf("\nY - Axis Coordinate: \t");
    scanf("%f", &b);
    printf("\nEnter The Coordinates of Point B:\n");
    printf("\nx - Axis Coordinate:\t");
    scanf("%f", &c);
    printf("\nY - Axis Coordinate: \t");
    scanf("%f", &d);
    distance = sqrt((c - a) * (c - a) + (d - b) * (d- b));
    printf("\nDistance between Points A and B: %f\n",  distance);
    return 0;
}

Post a Comment

0 Comments