PRINT Lab Week 2, Question 1 What channel is SYFY? --------------------- Write a SELECT statement that finds the channels named SYFYP and SYFYHDP in the CHANNEL table of the TV database. Use a WHERE clause with an OR statement to return only these two channels. Display only the ChannelNumber and DisplayName columns. Hint: Correct results will look like this (note that DisplayName is 200 characters wide, so I''ve edited a bit): ChannelNumber DisplayName ------------- ----------- 59 SYFYP 1411 SYFYHDP ' + CHAR(10) GO -- -- [Insert your code here] --
PRINT Lab Week 2, Question 2: What channel is OPB? --------------------- Write a SELECT statement that finds all the channels with OPB in the display name. Use a WHERE clause with LIKE and wildcards to find all matching channels. Display only the ChannelNumber and DisplayName columns. This time, use CONVERT to make the DisplayName be 10 characters wide. Use AS to give your column a name. Display results in ascending order by ChannelNumber. Hint: Correct results will look like this: ChannelNumber ChannelName ------------- ----------- 10 KOPB 1010 KOPBDT 1165 KOPBDT2 1166 KOPBDT3 ' + CHAR(10) GO -- -- [Insert your code here] --
using Microsoft SQL Server Management Studio 2012 (or later)
or DataGrip
The queries for the questions are given below-
ANSWER 1
===========
SELECT ChannelNumber, DisplayName
FROM CHANNEL
WHERE DisplayName = "SYFYP" OR DisplayName = "SYFYHDP"
ANSWER 2
=========
SELECT ChannelNumber, CONVERT(VARCHAR(10), DisplayName) AS
ChannelName
FROM CHANNEL
WHERE DisplayName LIKE "%OPB%"
ORDER BY ChannelNumber
PRINT Lab Week 2, Question 1 What channel is SYFY? --------------------- Write a SELECT statement that...
1.What is the return value if the user try to do the
following:
SELECT TRUNC (65.73,-2) FROM DUAL;
Select one:
a. 60
b. 00
c. 0
d. 600
2.Supposed that the user uses the ff SELECT statement: what will
be the possible output.
SELECT GRADE AS STUDENT MARK
FROM GRADE_REPORT;
Select one:
a. Error because of the keyword AS.
b. Error because of missing “” mark.
c. Will display the column GRADE rename as STUDENT MAK
d. Will display all...
11.9 Week 11 Lab: 2D Arrays For this lab, you only need to write a single user-defined function that analyzes a 2D array of chars. You do NOT need to write any of the code in main0 that calls your function. Make sure to use the template and only add code to the user-defined function. Write a function win0 with the following definition (i.e. prototype): int win(char board17)15), char player) The function win0 should return a 1 if the character...
The lab for this week addresses taking a logical database design (data model) and transforming it into a physical model (tables, constraints, and relationships). As part of the lab, you will need to download the zip file titled CIS336Lab3Files from Doc Sharing. This zip file contains the ERD, Data Dictionary, and test data for the tables you create as you complete this exercise. Your job will be to use the ERD Diagram found below as a guide to define the...
Write in C
Spring 2016 Lab Assignment 11 ET2100 In computer programming in general a "string" is a sequence of characters. In the C language anything within double quotes is a "string constant" so you have been seeing strings all semester. But we can also have string variables. In the C language these are implemented as an array of char, e.g. char name (10]: In order to make these variables easier to work with, it has been universally agreed that...
CIST 2371 Introduction to Java Unit 03 Lab Due Date: ________ Part 1 – Using methods Create a folder called Unit03 and put all your source files in this folder. Write a program named Unit03Prog1.java. This program will contain a main() method and a method called printChars() that has the following header: public static void printChars(char c1, char c2) The printChars() method will print out on the console all the characters between c1 and c2 inclusive. It will print 10...
Use only a single SQL statement for each of the following questions 1 Give a listing of all the ssns,first names and the class descriptions of all the classes the students are taking. If there are no class _descriptions display 'No description is available yet'. (USE NVL) 2 Give a listing of only the lname and the class_code for students who are taking 'Introduction to C programming'. (Inner join) 3 Give a lising of all the class_descriptions and the number...
Hi
good day i need homework help fast please
d32 1./What is the maximum length that a VARCHAR data type can be: a. 65535 b. 1023 C. 255 d. 32767 2.) Why are alias' used for table and columns? a. to make the names easier to understand b. to hide the column or table c. to be able to remove them from the database d. to give the appearance that they are new- 3.)What does the FIELD function allow you...
I need java code for the following problem.
Lab 7: Methods 1. Write a Java program called Numbers that calls the following methods and displays the returned value: Write a method called cubelt that accepts one integer parameter and returns the value raised to the third power as an integer. o Write a method called randominRange that accepts two integer parameters representing a range. The method returns a random integer in the specified range inclusive. 2. o Write a method...
1. Write a C++ program called Password that handles encrypting a
password.
2. The program must perform encryption as follows:
a. main method
i. Ask the user for a password.
ii. Sends the password to a boolean function called
isValidPassword to check validity.
1. Returns true if password is at least 8 characters long
2. Returns false if it is not at least 8 characters long
iii. If isValidPassword functions returns false
1. Print the following error message “The password...
Lab 2: (one task for Program 5): Declare an array of C-strings to hold course names, and read in course names from an input file. Then do the output to show each course name that was read in. See Chapter 8 section on "C-Strings", and the section "Arrays of Strings and C-strings", which gives an example related to this lab. Declare the array for course names as a 2-D char array: char courseNames[10] [ 50]; -each row will be a...