>> .. do a loop statement for the following table <<
Where is the DDL for this table? We don't have loops in SQL! This is a set-oriented declarative language. If this were zoology newsgroup, you'd be the guy talking about gorilla eggs :-). You also don't seem to understand that a table must have a key. By definition. This is not an option . There is no such thing as a generic "id" in RDBMS, but I'm going to guess that's what you were trying to use for a key. None of your column names do not make any sense or follow ISO 11179 naming rules. I also find it amazing that your careful planning and design led to VARCHAR(20) NOT NULL for everything. Surely no competent database designer would just randomly grab a declaration for a column like this. You also don't seem to know that you can do a table constructor in an insertion statement. I'm sure this was a result of careful research, but I've never used float in 30+ years of SQL. But if I did use them I would not input them as strings!
CREATE TABLE Samples
(sample_id VARCHAR(20) NOT NULL PRIMARY KEY, -- requiredired!!,
e_id VARCHAR(20) NOT NULL,
foobar_type VARCHAR(20) NOT NULL,
dur FLOAT NOT NULL);
INSERT INTO Samples
('01', 'e1', 't1', 18.00),
('02', 'e2', 't1', 14.00),
('03', 'e3', 't2', 20.00),
('04', 'e4', 't3', 13.00),
('05', 'e5', 't3', 15.00);
We now have a usable chunk of DDL and sample data. Now what were you trying to do?
Please post DDL and follow ANSI/ISO standards when asking for help.